Пример #1
0
def test_finished_not_found():
    """Ask if model is finished that hasnt been launched by this experiment"""
    rs = RunSettings("python")
    model = Model("hello", {}, "./", rs)
    cont = Controller(launcher="local")
    with pytest.raises(SmartSimError):
        cont.finished(model)
Пример #2
0
def test_bad_orc_checkpoint():
    checkpoint = "./bad-checkpoint"
    cont = Controller(launcher="local")
    with pytest.raises(FileNotFoundError):
        cont.reload_saved_db(checkpoint)
Пример #3
0
def test_catch_empty_ensemble():
    e = Ensemble("empty", {}, batch_settings=SbatchSettings())
    cont = Controller(launcher="local")
    with pytest.raises(SSConfigError):
        cont._sanity_check_launch(None, [e])
Пример #4
0
def test_wrong_orchestrator():
    orc = PBSOrchestrator(6780, db_nodes=3)
    cont = Controller(launcher="local")
    with pytest.raises(SSConfigError):
        cont._sanity_check_launch(orc, [])
Пример #5
0
def test_no_launcher():
    """Test when user provideds unsupported launcher"""
    cont = Controller(launcher="local")
    with pytest.raises(SSConfigError):
        cont.init_launcher(None)
Пример #6
0
def test_unsupported_launcher():
    """Test when user provideds unsupported launcher"""
    cont = Controller(launcher="local")
    with pytest.raises(SSUnsupportedError):
        cont.init_launcher("lsf")
Пример #7
0
def test_entity_list_status_wrong_type():
    cont = Controller(launcher="local")
    with pytest.raises(TypeError):
        cont.get_entity_list_status([])
Пример #8
0
def test_finished_entity_wrong_type():
    """Wrong type supplied to controller.finished"""
    cont = Controller(launcher="local")
    with pytest.raises(TypeError):
        cont.finished([])
Пример #9
0
def test_finished_entity_orc_error():
    """Orchestrators are never 'finished', either run forever or stopped by user"""
    orc = Orchestrator()
    cont = Controller(launcher="local")
    with pytest.raises(TypeError):
        cont.finished(orc)