示例#1
0
    def test_constructor(self):
        # Construct on properly initialized directory
        store = PasswordStore(self.dir)
        self.assertEqual(store._get_gpg_id(self.dir), '5C5833E3')
        self.assertFalse(store.uses_git)
        self.assertEqual(self.dir, store.path)

        # Fail gracefully on missing .gpg-id
        gpg_id_path = os.path.join(self.dir, '.gpg-id')
        os.remove(gpg_id_path)
        self.assertRaises(Exception, PasswordStore, self.dir)