def test_set_cells_no_balances_correct_headers(): cells = [Mock(), Mock()] set_cells = _set_cells(cells, []) assert set_cells[0].value == 'Date' assert set_cells[1].value == 'Total Aim'
def test_set_cells_one_balance_correct_length(): cells = [Mock() for x in range(4)] Balance = namedtuple('Balance', 'date amount') balances = [Balance(date(2016, 3, 1), Money(500))] set_cells = _set_cells(cells, balances) assert len(set_cells) == 4
def test_set_cells_one_balance_correct_values(): cells = [Mock() for x in range(4)] Balance = namedtuple('Balance', 'date amount') balances = [Balance(date(2016, 3, 1), Money(500))] set_cells = _set_cells(cells, balances) assert set_cells[2].value == date(2016, 3, 1) assert set_cells[3].value == Money(500)
def test_set_cells_no_balances_correct_length(): cells = [Mock(), Mock()] set_cells = _set_cells(cells, []) assert len(set_cells) == 2