Example #1
0
def test_create_scorer_collection(default_config):
    collection = ScorerCollection(default_config)

    assert len(collection) == 5

    assert "state score" in collection.names()
    assert "number of reactions" in collection.names()

    assert isinstance(collection["state score"], StateScorer)

    with pytest.raises(KeyError):
        collection["dummy"]
Example #2
0
def test_load_scorer_to_collection_only_class(default_config):
    collection = ScorerCollection(default_config)
    del collection["state score"]

    collection.load_from_config(**{"StateScorer": {}})

    assert "state score" in collection.names()
Example #3
0
def test_add_scorer_to_collection(default_config):
    collection = ScorerCollection(default_config)
    del collection["state score"]

    collection.load(StateScorer(default_config))

    assert "state score" in collection.names()
Example #4
0
def test_load_scorer_to_collection_full_package(default_config):
    collection = ScorerCollection(default_config)
    del collection["state score"]

    collection.load_from_config(**{"aizynthfinder.context.scoring.StateScorer": {}})

    assert "state score" in collection.names()
Example #5
0
def test_delete_scorer_to_collection(default_config):
    collection = ScorerCollection(default_config)

    del collection["state score"]

    assert "state score" not in collection.names()