def test_corrode__corrodable_calls_add_erosion(mocker): mocker.patch('components.material.MaterialComponent.add_erosion') m = MaterialComponent('IRON', 'RUST') # No corrode, means always calls add_erosion m.corrode() m.add_erosion.assert_called_once()
def test_corrode__noncorrodable_returns_False(): m = MaterialComponent('WOOD', 'BURN') assert m.corrode() is False
def test_corrode__corrodable_returns_True(): m = MaterialComponent('IRON', 'RUST', 'CORRODE') assert m.corrode()