From e59d345917f5206f2b715a67e6ce2afe28e12a8a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 21 May 2013 14:27:50 -0400 Subject: [PATCH] Use a different arbitrary dotted module, which Christina doesn't already have imported --- common/lib/capa/capa/safe_exec/tests/test_lazymod.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/lib/capa/capa/safe_exec/tests/test_lazymod.py b/common/lib/capa/capa/safe_exec/tests/test_lazymod.py index 68dcd81ea7..6a8ed5ff48 100644 --- a/common/lib/capa/capa/safe_exec/tests/test_lazymod.py +++ b/common/lib/capa/capa/safe_exec/tests/test_lazymod.py @@ -39,6 +39,9 @@ class TestLazyMod(unittest.TestCase): self.assertEqual(hsv[0], 0.25) def test_dotted(self): - self.assertNotIn("email.utils", sys.modules) - email_utils = LazyModule("email.utils") - self.assertEqual(email_utils.quote('"hi"'), r'\"hi\"') + # wsgiref is a module with submodules that is not already imported. + # Any similar module would do. This test demonstrates that the module + # is not already im + self.assertNotIn("wsgiref.util", sys.modules) + wsgiref_util = LazyModule("wsgiref.util") + self.assertEqual(wsgiref_util.guess_scheme({}), "http")