From f480da7fc1637e64c1dcd0d564546157c3cbc7b1 Mon Sep 17 00:00:00 2001 From: Gustavo Niemeyer Date: Tue, 13 Nov 2007 21:40:47 -0200 Subject: When using an unexistent import path for Mocker.proxy(), raise an ImportError on the base module, rather than using the actual string as the object (#162315). --- test.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test.py') diff --git a/test.py b/test.py index 236aa0c..ecbb74d 100755 --- a/test.py +++ b/test.py @@ -875,6 +875,9 @@ class MockerTest(unittest.TestCase): module = self.mocker.proxy("os.path", name="mock") self.assertEquals(module.__mocker_name__, "mock") + def test_proxy_with_unexistent_module(self): + self.assertRaises(ImportError, self.mocker.proxy, "unexistent.module") + def test_replace(self): from os import path obj = object() -- cgit v1.2.1