Exemplo n.º 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)
Exemplo n.º 2
0
def test_bad_orc_checkpoint():
    checkpoint = "./bad-checkpoint"
    cont = Controller(launcher="local")
    with pytest.raises(FileNotFoundError):
        cont.reload_saved_db(checkpoint)
Exemplo n.º 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])
Exemplo n.º 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, [])
Exemplo n.º 5
0
def test_no_launcher():
    """Test when user provideds unsupported launcher"""
    cont = Controller(launcher="local")
    with pytest.raises(SSConfigError):
        cont.init_launcher(None)
Exemplo n.º 6
0
def test_unsupported_launcher():
    """Test when user provideds unsupported launcher"""
    cont = Controller(launcher="local")
    with pytest.raises(SSUnsupportedError):
        cont.init_launcher("lsf")
Exemplo n.º 7
0
def test_entity_list_status_wrong_type():
    cont = Controller(launcher="local")
    with pytest.raises(TypeError):
        cont.get_entity_list_status([])
Exemplo n.º 8
0
def test_finished_entity_wrong_type():
    """Wrong type supplied to controller.finished"""
    cont = Controller(launcher="local")
    with pytest.raises(TypeError):
        cont.finished([])
Exemplo n.º 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)