summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2007-11-13 21:40:47 -0200
committerGustavo Niemeyer <gustavo@niemeyer.net>2007-11-13 21:40:47 -0200
commitf480da7fc1637e64c1dcd0d564546157c3cbc7b1 (patch)
treebd5fadd422f4172551d14e53452766e0e8b1c8b3 /test.py
parentbbe24209cd365b317a70175c898da6217cc64f96 (diff)
downloadmocker-f480da7fc1637e64c1dcd0d564546157c3cbc7b1.tar.gz
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).
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py3
1 files changed, 3 insertions, 0 deletions
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()