예제 #1
0
파일: test1.py 프로젝트: cdede/pwvault
    def setUp(self):
        filename = "example_export.conf"
        try:
            os.unlink("w.gpg")
        except:
            pass
        db, key1 = opendb(filename, "a")
        ed1 = ExportDb(db, key1)
        ed1.export()
        filename1 = "example_config"
        file1, _ = open_conf_1(filename1)

        self.cmd = PassServer(file1)
예제 #2
0
파일: test1.py 프로젝트: cdede/pwvault
class KeepassTest(unittest.TestCase):
    def setUp(self):
        filename = "example_export.conf"
        try:
            os.unlink("w.gpg")
        except:
            pass
        db, key1 = opendb(filename, "a")
        ed1 = ExportDb(db, key1)
        ed1.export()
        filename1 = "example_config"
        file1, _ = open_conf_1(filename1)

        self.cmd = PassServer(file1)

    def test_start(self):
        a = self.cmd.start_key(["", True])
        self.assertTrue(("Internet_a_c   c\nInternet_e   e\n", {}) == a)
        a = self.cmd.start_key(["a", True])
        self.assertTrue(("comment :  \nurl :  c\n", {"password": "******", "key": "Internet_a_c", "username": "******"}) == a)
        a = self.cmd.start_key(["as", True])
        self.assertTrue(("no term\n", {}) == a)