1 # -*- coding: utf-8 -*-
2 $LOAD_PATH.unshift '../lib'
5 require 'ldblogwriter/config.rb'
6 require 'ldblogwriter/command.rb'
7 require 'ldblogwriter/entry.rb'
9 class TestCommand < Test::Unit::TestCase
13 def test_google_auth_token
16 def test_get_auth_info
17 com = LDBlogWriter::Command.new('hoge')
18 assert_raise(ArgumentError) {com.get_auth_info("hoge", "huga")}
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])
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])
38 test_entry = LDBlogWriter::BlogEntry.new(LDBlogWriter::Config.new('test.conf'),
42 LDBlogWriter::Command.new.post('http://localhost:8080/', 'user', 'pass',