예제 #1
0
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()
예제 #2
0
def test_corrode__noncorrodable_returns_False():
    m = MaterialComponent('WOOD', 'BURN')
    assert m.corrode() is False
예제 #3
0
def test_corrode__corrodable_returns_True():
    m = MaterialComponent('IRON', 'RUST', 'CORRODE')
    assert m.corrode()