class TdbSamTestCase(TestCase): def setUp(self): super(TdbSamTestCase, self).setUp() self.samdb = TdbSam(os.path.join(DATADIR, "passdb.tdb")) def tearDown(self): self.samdb.close() super(TdbSamTestCase, self).tearDown() def test_usernames(self): self.assertEquals(3, len(list(self.samdb.usernames()))) def test_getuser(self): user = SAMUser("root") user.logoff_time = 2147483647 user.kickoff_time = 2147483647 user.pass_can_change_time = 1125418267 user.username = "******" user.uid = None user.lm_password = '******' user.nt_password = '******' user.acct_ctrl = 16 user.pass_last_set_time = 1125418267 user.fullname = "root" user.nt_username = "" user.logoff_time = 2147483647 user.acct_desc = "" user.group_rid = 1001 user.logon_count = 0 user.bad_password_count = 0 user.domain = "BEDWYR" user.munged_dial = "" user.workstations = "" user.user_rid = 1000 user.kickoff_time = 2147483647 user.logoff_time = 2147483647 user.unknown_6 = 1260L user.logon_divs = 0 user.hours = [True for i in range(168)] other = self.samdb["root"] for name in other.__dict__: if other.__dict__[name] != user.__dict__[name]: print "%s: %r != %r" % (name, other.__dict__[name], user.__dict__[name]) self.assertEquals(user, other)
def setUp(self): self.samdb = TdbSam(os.path.join(DATADIR, "passdb.tdb"))
def setUp(self): super(TdbSamTestCase, self).setUp() self.samdb = TdbSam(os.path.join(DATADIR, "passdb.tdb"))