Example #1
0
def test_PowerMulti_calls_targets_on_methods():
    num_mock_powers = 3
    mock_powers = [MockPower() for __ in range(0, num_mock_powers)]

    power = PowerMulti(power_seq=mock_powers)

    power.on()

    assert (all([mp.on_called == 1 for mp in mock_powers]))
Example #2
0
def test_PowerMulti_calls_targets_on_methods_in_correct_order():
    mocks_on_list = []
    num_mock_powers = 3
    mock_powers = [
        MockPower(mocks_on_list=mocks_on_list)
        for __ in range(0, num_mock_powers)
    ]

    power = PowerMulti(power_seq=mock_powers)

    power.on()

    assert (mock_powers == mocks_on_list)