<s> import pytest <EOL> import types <EOL> from flask_factory . utils import import_string <EOL> def test_import_module_by_string ( ) : <EOL> with pytest . raises ( ImportError ) : <EOL> import_string ( '<STR_LIT>' ) <EOL> m = import_string ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert isinstance ( m , types . ModuleType ) <EOL> assert m . __name__ == '<STR_LIT>' <EOL> def test_import_object_by_string ( ) : <EOL> answer = import_string ( '<STR_LIT>' ) <EOL> assert answer == <NUM_LIT> <EOL> widget = import_string ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert isinstance ( widget , type ) <EOL> assert widget . __module__ == '<STR_LIT>' <EOL> def test_import_default ( ) : <EOL> m = import_string ( '<STR_LIT>' , default = None ) <EOL> assert m is None </s>
