예제 #1
0
 def test_simple_search(self):
     """Test simple substring searching."""
     with TemporaryDirectory() as directory:
         touch(os.path.join(directory, 'foo.gpg'))
         touch(os.path.join(directory, 'bar.gpg'))
         touch(os.path.join(directory, 'baz.gpg'))
         program = PasswordStore(directory=directory)
         matches = program.simple_search('fo')
         assert len(matches) == 1
         assert matches[0].name == 'foo'
         matches = program.simple_search('a')
         assert len(matches) == 2
         assert matches[0].name == 'bar'
         assert matches[1].name == 'baz'
         matches = program.simple_search('b', 'z')
         assert len(matches) == 1
         assert matches[0].name == 'baz'
예제 #2
0
 def test_simple_search(self):
     """Test simple substring searching."""
     with TemporaryDirectory() as directory:
         touch(os.path.join(directory, "foo.gpg"))
         touch(os.path.join(directory, "bar.gpg"))
         touch(os.path.join(directory, "baz.gpg"))
         program = PasswordStore(directory=directory)
         matches = program.simple_search("fo")
         assert len(matches) == 1
         assert matches[0].name == "foo"
         matches = program.simple_search("a")
         assert len(matches) == 2
         assert matches[0].name == "bar"
         assert matches[1].name == "baz"
         matches = program.simple_search("b", "z")
         assert len(matches) == 1
         assert matches[0].name == "baz"