MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_import_from

Method test_import_from

tests/bundle/test_config_item.py:118–122  ·  view source on GitHub ↗
(self, stmt, mod_name)

Source from the content-addressed store, hash-verified

116 ]
117 )
118 def test_import_from(self, stmt, mod_name):
119 test_globals = {}
120 ConfigExpression(id="", config=stmt, globals=test_globals).evaluate()
121 self.assertTrue(callable(test_globals[mod_name]))
122 self.assertTrue(ConfigExpression.is_import_statement(ConfigExpression(id="", config=stmt).config))
123
124 @parameterized.expand(
125 [("$from json import dump", True), ("$print()", False), ("$import json", True), ("import json", False)]

Callers

nothing calls this directly

Calls 3

ConfigExpressionClass · 0.90
is_import_statementMethod · 0.80
evaluateMethod · 0.45

Tested by

no test coverage detected