Пример #1
0
def test_clear_simulations():
    experiment = Experiment()
    experiment.add_simulations([simulation, simulation, simulation])
    assert experiment.clear_simulations()
    assert experiment.get_simulations() == []
    assert not experiment.clear_simulations()
    assert experiment.get_simulations() == []
Пример #2
0
def test_add_simulations():
    experiment = Experiment()
    experiment.add_simulations([simulation, simulation])
    assert experiment.get_simulations() == [simulation, simulation]
    experiment.add_simulations(simulation)
    assert experiment.get_simulations() == [simulation, simulation, simulation]
    with pytest.raises(Exception):
        experiment.add_simulations(None)
Пример #3
0
def test_add_simulations():
    experiment = Experiment()
    experiment.add_simulations([simulation, simulation])
    assert experiment.get_simulations() == [simulation, simulation]
    experiment.add_simulations(simulation)
    assert experiment.get_simulations() == [simulation, simulation, simulation]