def test_addSameClient(self): tst_db = DB('test.db') tst_db.dropTables() if not (tst_db.addClient(client_json)): self.fail() if tst_db.addClient(client_json): self.fail()
def test_getTrades(self): nj = TestDB.makeTradeJsons() db = DB('test.db') db.dropTables() db.addClient(test_DB.client_json) pf_j = TestDB.fillPortfolioVars(db, nj) self.failIf(not (db.addPortfolio(pf_j))) cp = ClientPortfolios(db,'*****@*****.**') a = [p['portfolioName'] for p in cp.getPortfolios()] self.failIf( len(a) <= 0) self.failIf(len([t['tradeId'] for t in cp.getTrades('My portfolio')]) <= 0)