def test_exceptions(): calc3 = Calculator(initial_value=20, maximum_value=30) calc3.add(3) assert calc3.value == 23 with pytest.raises(Exception): calc3.add(10) calc3.max_value = 40 calc3.add(10) assert calc3.value == 33
def test_undefinedAndNull(): calc = Calculator() assert calc.max_value is None calc.max_value = None