diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/short_key_vindex_result | 7 | ||||
-rw-r--r-- | test/unit/hkp_test.rb | 13 |
2 files changed, 19 insertions, 1 deletions
diff --git a/test/files/short_key_vindex_result b/test/files/short_key_vindex_result new file mode 100644 index 0000000..a410144 --- /dev/null +++ b/test/files/short_key_vindex_result @@ -0,0 +1,7 @@ +info:1:1 +pub:9A753A6B:17:1024:1252683790:: +uid:Tom%C3%A1s Touceda <chiiph@leap.se>:1368645663:: +uid:Tomas Touceda <chiiph@riseup.net>:1361376077:: +uid:Tom%C3%A1s Touceda <chiiph@gmail.com>:1252683790:: +uid:Tom%C3%A1s Touceda <chiiph@gentoo.org>:1270489372:: +uid:Tom%C3%A1s Touceda <chiiph@torproject.org>:1306498697::
\ No newline at end of file diff --git a/test/unit/hkp_test.rb b/test/unit/hkp_test.rb index 1b7b2c9..c211690 100644 --- a/test/unit/hkp_test.rb +++ b/test/unit/hkp_test.rb @@ -21,7 +21,7 @@ class HkpTest < MiniTest::Unit::TestCase def test_key_info_reject_keysize fetch_key_info :hkp_vindex_result, 'frog@leap.se' do |keys| - assert_equal 1, keys.length, 'should find one key' + assert_equal 1, keys.length, 'should find one key' # because short key gets ignored assert_equal '00440025', keys.first.keyid end end @@ -67,6 +67,17 @@ class HkpTest < MiniTest::Unit::TestCase end end + def test_fetch_key_too_short + uid = 'chiiph@leap.se' + key_id = '9A753A6B' + + stub_sks_vindex_reponse(uid, :body => file_content(:short_key_vindex_result)) + test_em_errback "Nickserver::HKP::FetchKey.new.get '#{uid}'" do |error| + assert_equal 500, error + end + end + + protected # |