Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviernogueira committed Jun 5, 2023
2 parents acce427 + 6539476 commit 405275e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_1_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,19 @@ def test_classification_models() -> None:
classification_models[0],
)
assert issubclass(first_model_obj, tabular_ml.base.MLModel)


def test_factory_methods() -> None:
"""Test unregister_model and register_model methods."""

# get a copy of a model class
model_name = tabular_ml.ModelFactory.get_regression_models()[0]
model = tabular_ml.ModelFactory.get_regression_model(model_name)

# unregister the model
tabular_ml.ModelFactory.unregister_model(model_name)
assert model_name not in tabular_ml.ModelFactory.get_regression_models()

# re-register the model
tabular_ml.ModelFactory.register_model(model)
assert model_name in tabular_ml.ModelFactory.get_regression_models()

0 comments on commit 405275e

Please sign in to comment.