OSDN Git Service

no comments
[lbw/ldblogwriter2.git] / test / test-command.rb
1 # -*- coding: utf-8 -*-
2 $LOAD_PATH.unshift '../lib'
3
4 require 'test/unit'
5 require 'ldblogwriter/config.rb'
6 require 'ldblogwriter/command.rb'
7 require 'ldblogwriter/entry.rb'
8
9 class TestCommand < Test::Unit::TestCase
10   def setup
11   end
12
13   def test_google_auth_token
14   end
15
16   def test_get_auth_info
17     com = LDBlogWriter::Command.new('hoge')
18     assert_raise(ArgumentError) {com.get_auth_info("hoge", "huga")}
19
20     com = LDBlogWriter::Command.new
21     assert_equal('wsse', com.auth_type)
22     ret = com.get_auth_info("hoge", "huga")
23     assert_equal('X-WSSE', ret.keys[0])
24
25     com = LDBlogWriter::Command.new('google')
26     assert_equal('google', com.auth_type)
27 #    ret = com.get_auth_info("hoge", "huga")
28 #    assert_equal('Authorization', ret.keys[0])
29   end
30
31   def test_get
32   end
33
34   def test_upload
35   end
36
37   def test_post
38     test_entry = LDBlogWriter::BlogEntry.new(LDBlogWriter::Config.new('test.conf'),
39                                              "タイトル",
40                                              "カテゴリ",
41                                              "コンテンツ")
42     LDBlogWriter::Command.new.post('http://localhost:8080/', 'user', 'pass', 
43                                    test_entry)
44   end
45
46   def test_edit
47   end
48
49   def test_delete
50   end
51
52 end