mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-20 01:50:04 +00:00
add test to check add and delete gpg key
This commit is contained in:
parent
a1a21f9617
commit
b287b719fe
1 changed files with 22 additions and 0 deletions
|
@ -118,4 +118,26 @@ class TestMPW < Test::Unit::TestCase
|
|||
assert_equal(1, @mpw.list(pattern: 'existing').length)
|
||||
assert_equal(2, @mpw.list(pattern: 'host_[eu]').length)
|
||||
end
|
||||
|
||||
def test_06_add_gpg_key
|
||||
@config = MPW::Config.new
|
||||
@config.setup_gpg_key('password', 'test2@example.com', 2048)
|
||||
|
||||
@mpw.read_data
|
||||
|
||||
@mpw.add_key('test2@example.com')
|
||||
assert_equal(2, @mpw.keys.length)
|
||||
|
||||
@mpw.write_data
|
||||
end
|
||||
|
||||
def test07_delete_gpg_key
|
||||
@mpw.read_data
|
||||
assert_equal(2, @mpw.keys.length)
|
||||
|
||||
@mpw.delete_key('test2@example.com')
|
||||
assert_equal(1, @mpw.keys.length)
|
||||
|
||||
@mpw.write_data
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue