diff options
author | Gustavo Niemeyer <gustavo@niemeyer.net> | 2007-11-13 21:40:47 -0200 |
---|---|---|
committer | Gustavo Niemeyer <gustavo@niemeyer.net> | 2007-11-13 21:40:47 -0200 |
commit | f480da7fc1637e64c1dcd0d564546157c3cbc7b1 (patch) | |
tree | bd5fadd422f4172551d14e53452766e0e8b1c8b3 /test.py | |
parent | bbe24209cd365b317a70175c898da6217cc64f96 (diff) | |
download | mocker-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-x | test.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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() |