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)
def test_bad_orc_checkpoint(): checkpoint = "./bad-checkpoint" cont = Controller(launcher="local") with pytest.raises(FileNotFoundError): cont.reload_saved_db(checkpoint)
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])
def test_wrong_orchestrator(): orc = PBSOrchestrator(6780, db_nodes=3) cont = Controller(launcher="local") with pytest.raises(SSConfigError): cont._sanity_check_launch(orc, [])
def test_no_launcher(): """Test when user provideds unsupported launcher""" cont = Controller(launcher="local") with pytest.raises(SSConfigError): cont.init_launcher(None)
def test_unsupported_launcher(): """Test when user provideds unsupported launcher""" cont = Controller(launcher="local") with pytest.raises(SSUnsupportedError): cont.init_launcher("lsf")
def test_entity_list_status_wrong_type(): cont = Controller(launcher="local") with pytest.raises(TypeError): cont.get_entity_list_status([])
def test_finished_entity_wrong_type(): """Wrong type supplied to controller.finished""" cont = Controller(launcher="local") with pytest.raises(TypeError): cont.finished([])
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)