def test_wallet_spend_cash_raises_exception_on_insufficient_amount(): """ Asserts one cant spend more money than what's in the wallet """ wallet = Wallet() with pytest.raises(InsufficientAmount): wallet.spend_cash(100)
def test_wallet_spend_cash(): """ Testing Spending cash """ wallet = Wallet(20) wallet.spend_cash(10) assert wallet.balance == 10
def test_transactions(empty_wallet, earned, spent, expected): empty_wallet = Wallet() empty_wallet.add_cash(earned) empty_wallet.spend_cash(spent) assert empty_wallet.balance == expected