def setUp(self): for f, d in [(test_file, test_date), (test_file2, test_date2)]: oc = OpenCSV(f=f) position, overall = oc.get_symbol_lines() ip = ImportPosition(date=d, position=position, overall=overall) ip.save_overall() ip.save_position() del oc, ip #self.cv = ViewControl(date='2001-01-01') self.cv = ViewControl(date=test_date)
class TestOpenCSV(TestCase): def setUp(self): self.oc = OpenCSV(f=test_file) def tearDown(self): del self.oc def test_get_symbol_lines(self): position, overall = self.oc.get_symbol_lines() #print position print 'Positions in portfolio:' for s, p in position.items(): print s for i, d in p.items(): print i, d print print '\n' print 'Overall Item at Footer:' print overall
def setUp(self): oc = OpenCSV(f=test_file) position, overall = oc.get_symbol_lines() self.ip = ImportPosition(date=test_date, position=position, overall=overall)