summaryrefslogtreecommitdiff
path: root/test/test_codeunit.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-12-21 07:41:01 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-12-21 07:41:01 -0500
commit502fe3685098b7b0a9524c2e2de0d0db9de06ed9 (patch)
treeb4e66e248ab3f41d6541726d9cd3b36ae4a87fa2 /test/test_codeunit.py
parenta1f6641ca9d2e5cc395671ab6fe82b65949552a4 (diff)
parent9addc84bb39eddeccd31ee5a5f0fa387591e35dd (diff)
downloadpython-coveragepy-git-502fe3685098b7b0a9524c2e2de0d0db9de06ed9.tar.gz
Automated merge with ssh://bitbucket.org/ned/coveragepy
Diffstat (limited to 'test/test_codeunit.py')
-rw-r--r--test/test_codeunit.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_codeunit.py b/test/test_codeunit.py
index b543949c..a568fe56 100644
--- a/test/test_codeunit.py
+++ b/test/test_codeunit.py
@@ -89,7 +89,14 @@ class CodeUnitTest(CoverageTest):
assert bcu > acu and bcu >= acu and bcu != acu
def test_egg(self):
+ # Test that we can get files out of eggs, and read their source files.
+ # The egg1 module is installed by an action in igor.py.
import egg1, egg1.egg1
+ # Verify that we really imported from an egg. If we did, then the
+ # __file__ won't be an actual file, because one of the "directories"
+ # in the path is actually the .egg zip file.
+ self.assert_doesnt_exist(egg1.__file__)
+
cu = code_unit_factory([egg1, egg1.egg1], FileLocator())
self.assertEqual(cu[0].source_file().read(), "")
self.assertEqual(cu[1].source_file().read().split("\n")[0],