def test_success(self, filename): """ 2013-01-01 open Assets:Account1 2013-01-01 open Assets:Account2 2013-01-01 open Assets:Account3 2013-01-01 open Equity:Unknown 2013-04-05 * Equity:Unknown Assets:Account1 5000 USD 2013-04-05 * Assets:Account1 -3000 USD Assets:Account2 30 BOOG {100 USD} 2013-04-05 * Assets:Account1 -1000 USD Assets:Account3 800 EUR @ 1.25 USD """ with test_utils.capture() as stdout: test_utils.run_with_args(report.main, [filename, 'holdings']) output = stdout.getvalue() self.assertTrue( test_utils.search_words('Assets:Account1 1,000.00 USD', output)) self.assertTrue( test_utils.search_words('Assets:Account2 30.00 BOOG', output)) self.assertTrue( test_utils.search_words('Assets:Account3 800.00 EUR', output))
def test_search_words(self): test_utils.search_words('i walrus is', 'i am the walrus is not chicago') test_utils.search_words('i walrus is'.split(), 'i am the walrus is not chicago')