Beispiel #1
0
def test_import_from_cwd__custom_imp():
    imp = Mock(name='imp')
    with patch('importlib.import_module'):
        res = import_from_cwd('.foo', package='baz', imp=imp)
        assert res is imp.return_value
        imp.assert_called_once_with('.foo', package='baz')
Beispiel #2
0
def test_import_from_cwd__custom_imp():
    imp = Mock(name="imp")
    with patch("importlib.import_module"):
        res = import_from_cwd(".foo", package="baz", imp=imp)
        assert res is imp.return_value
        imp.assert_called_once_with(".foo", package="baz")
Beispiel #3
0
def test_import_from_cwd():
    with patch('mode.utils.imports.cwd_in_path'):
        with patch('importlib.import_module') as import_module:
            res = import_from_cwd('.foo', package='baz')
            assert res is import_module.return_value
            import_module.assert_called_once_with('.foo', package='baz')
Beispiel #4
0
def test_import_from_cwd():
    with patch("mode.utils.imports.cwd_in_path"):
        with patch("importlib.import_module") as import_module:
            res = import_from_cwd(".foo", package="baz")
            assert res is import_module.return_value
            import_module.assert_called_once_with(".foo", package="baz")