def test_recordAccount(self): db = Db(path=self.f.name + '/tmp') account = db.accountByName('test') db.recordAccount(account) self.assertTrue(account.isValid()) self.assertTrue(account.exists())
def test_accountByName_when_it_exists(self): db = Db(path=self.f.name + '/tmp') account = db.accountByName('test') db.recordAccount(account) account2 = db.accountByName('test') self.assertEqual(account.id, account2.id)
def test_accountByName_when_it_does_not_exists(self): db = Db(path=self.f.name + '/tmp') account = db.accountByName('test') self.assertTrue(account.isValid()) self.assertFalse(account.exists())