summaryrefslogtreecommitdiff
path: root/test/unit/hkp_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/hkp_test.rb')
-rw-r--r--test/unit/hkp_test.rb13
1 files changed, 12 insertions, 1 deletions
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
#