diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-09-29 22:21:48 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-09-29 22:21:48 -0400 |
commit | 168176ef145c81732aa1d98240955977eec547a7 (patch) | |
tree | 0031e662c48ccd529368aec1e637d2ac5d3b0aae /test | |
parent | cf40fd72eb6cb7c8de48eb98f104fbef99cd780f (diff) | |
download | python-coveragepy-git-168176ef145c81732aa1d98240955977eec547a7.tar.gz |
Working toward reading source from eggs, but this isn't right on Py3k yet.
Diffstat (limited to 'test')
-rw-r--r-- | test/eggsrc/egg1/__init__.py | 0 | ||||
-rw-r--r-- | test/eggsrc/egg1/egg1.py | 4 | ||||
-rw-r--r-- | test/eggsrc/setup.py | 6 | ||||
-rw-r--r-- | test/test_codeunit.py | 9 |
4 files changed, 19 insertions, 0 deletions
diff --git a/test/eggsrc/egg1/__init__.py b/test/eggsrc/egg1/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/eggsrc/egg1/__init__.py diff --git a/test/eggsrc/egg1/egg1.py b/test/eggsrc/egg1/egg1.py new file mode 100644 index 00000000..3fadde33 --- /dev/null +++ b/test/eggsrc/egg1/egg1.py @@ -0,0 +1,4 @@ +# My egg file! + +walrus = "Eggman" +says = "coo-coo cachoo" diff --git a/test/eggsrc/setup.py b/test/eggsrc/setup.py new file mode 100644 index 00000000..6a88a58b --- /dev/null +++ b/test/eggsrc/setup.py @@ -0,0 +1,6 @@ +from setuptools import setup + +setup( + name="covtestegg1", + packages=['egg1'], + ) diff --git a/test/test_codeunit.py b/test/test_codeunit.py index 36ca1fcd..0c2fc98a 100644 --- a/test/test_codeunit.py +++ b/test/test_codeunit.py @@ -71,3 +71,12 @@ class CodeUnitTest(CoverageTest): assert zcu > acu and zcu >= acu and zcu != acu assert acu < bcu and acu <= bcu and acu != bcu assert bcu > acu and bcu >= acu and bcu != acu + + def test_egg(self): + import egg1, egg1.egg1 + 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], + "# My egg file!" + ) +
\ No newline at end of file |