示例#1
0
def test_change_password():
    copyfile(DB_ORIGIN, DB_FILE)
    pdb = PassDB(DB_FILE)
    user = pdb["naota"]
    user.set_password("hogefuga")
    pdb["naota"] = user
    pdb.close()
    db = tdb.open(DB_FILE)
    assert unpack_user(db["USER_naota\x00"]).nt_pw == \
        nthash("hogefuga").decode("hex")
    db.close()
示例#2
0
 def __iter__(self):
     for x in self.db:
         if x.startswith("USER_"):
             yield unpack_user(self.db[x])
示例#3
0
 def __getitem__(self, name):
     return unpack_user(self.db[userkey(name)])
示例#4
0
def pytest_funcarg__user_bin():
    return unpack_user(blob)
示例#5
0
文件: passdb.py 项目: naota/pypassdb
 def __iter__(self):
     for x in self.db:
         if x.startswith("USER_"):
             yield unpack_user(self.db[x])
示例#6
0
文件: passdb.py 项目: naota/pypassdb
 def __getitem__(self, name):
     return unpack_user(self.db[userkey(name)])