Exemple #1
0
def test_clear(num_scenarios):
    # Creates a number of scenarios - these are not interesting, per se, only
    # that they are properly cleared from the cache once clear() is called.
    scenarios = [Scenario(f"Scen {idx}", "", "", 1 / num_scenarios)
                 for idx in range(num_scenarios)]

    assert_equal(Scenario.num_scenarios(), num_scenarios)
    assert_equal(Scenario.scenarios(), scenarios)

    Scenario.clear()

    assert_equal(Scenario.num_scenarios(), 0)
    assert_equal(Scenario.scenarios(), [])
Exemple #2
0
 def scenarios(self) -> List[Scenario]:
     return Scenario.scenarios()