Move instanciation out of search_object

This commit is contained in:
Matthias
2019-12-24 14:01:28 +01:00
parent 25e6d6a7bf
commit 5a11ca86bb
2 changed files with 7 additions and 11 deletions

View File

@@ -15,19 +15,16 @@ from tests.conftest import log_has, log_has_re
def test_search_strategy():
default_config = {}
default_location = Path(__file__).parent.parent.joinpath('strategy').resolve()
s, _ = StrategyResolver._search_object(
directory=default_location,
kwargs={'config': default_config},
object_name='DefaultStrategy'
)
assert isinstance(s, IStrategy)
assert issubclass(s, IStrategy)
s, _ = StrategyResolver._search_object(
directory=default_location,
kwargs={'config': default_config},
object_name='NotFoundStrategy'
)
assert s is None