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

Method test_is_import_stmt

tests/bundle/test_config_item.py:127–130  ·  view source on GitHub ↗
(self, stmt, expected)

Source from the content-addressed store, hash-verified

125 [("$from json import dump", True), ("$print()", False), ("$import json", True), ("import json", False)]
126 )
127 def test_is_import_stmt(self, stmt, expected):
128 expr = ConfigExpression(id="", config=stmt)
129 flag = expr.is_import_statement(expr.config)
130 self.assertEqual(flag, expected)
131
132 def test_error_expr(self):
133 with self.assertRaisesRegex(RuntimeError, r"1\+\[\]"):

Callers

nothing calls this directly

Calls 2

is_import_statementMethod · 0.95
ConfigExpressionClass · 0.90

Tested by

no test coverage detected