def cashflow_report(conn, cur): option = input( "Cashflow report phase > \nEnter 1.CAMPAIGN / 2.SUPPORTER option number: " ) if int(option) is 1: op = Accounting() op.op_list(cur) print("\nCampaign cashflow bar chart: ") op.op_graph(cur) elif int(option) is 2: sp = Accounting() sp.sp_list(cur) print("\nSupporter cashflow bar chart: ") sp.sp_graph(cur) return 1
def setUp(self): """ test up method. Returns: none (NoneType): None """ self.accounting = Accounting()
class TestAccounting(unittest.TestCase): accounting = Accounting() def test_start_connection(self): self.assertEqual(self.accounting.start_connection(), "Connection Successful") def test_calculate_income(self): self.assertEqual( self.accounting.calculate_ticket_income(2), "The total income from ticket sales for flight 2 is: £1180.00")
def setUp(self): """ test up method. Returns: none (NoneType): None """ self.options = { 'number': { 'thousand': ',', 'precision': 0, 'decimal': '.', 'grouping': 3 } } self.accounting = Accounting(self.options)
def setUp(self): self.a = Accounting()
def test_process(self, mock_load, mock_open): self.a = Accounting() self.assertEqual(self.a.process("bob"), 5, "Wrong calculation")