summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-03-14 22:35:41 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-03-14 22:35:41 -0400
commitc7ae0afc9f67410fd86e1e69f5baa2f50d5346bc (patch)
tree30f4804f6110cb46013a37a714f0f2bfc77e36c2 /test
parente1e4f3a2e99dfb90c5df3c8d0ef4acba19b048b0 (diff)
downloadpython-coveragepy-git-c7ae0afc9f67410fd86e1e69f5baa2f50d5346bc.tar.gz
Source files can have more than one dot in them. Fixes issue #46.
Diffstat (limited to 'test')
-rw-r--r--test/modules/aa/afile.odd.py1
-rw-r--r--test/modules/aa/bb.odd/bfile.py1
-rw-r--r--test/modules/aa/bb/bfile.odd.py1
-rw-r--r--test/test_codeunit.py14
4 files changed, 17 insertions, 0 deletions
diff --git a/test/modules/aa/afile.odd.py b/test/modules/aa/afile.odd.py
new file mode 100644
index 00000000..c6f49e18
--- /dev/null
+++ b/test/modules/aa/afile.odd.py
@@ -0,0 +1 @@
+# afile.odd.py
diff --git a/test/modules/aa/bb.odd/bfile.py b/test/modules/aa/bb.odd/bfile.py
new file mode 100644
index 00000000..90875404
--- /dev/null
+++ b/test/modules/aa/bb.odd/bfile.py
@@ -0,0 +1 @@
+# bfile.py
diff --git a/test/modules/aa/bb/bfile.odd.py b/test/modules/aa/bb/bfile.odd.py
new file mode 100644
index 00000000..b45cba8c
--- /dev/null
+++ b/test/modules/aa/bb/bfile.odd.py
@@ -0,0 +1 @@
+# bfile.odd.py
diff --git a/test/test_codeunit.py b/test/test_codeunit.py
index 35387ba3..7903d153 100644
--- a/test/test_codeunit.py
+++ b/test/test_codeunit.py
@@ -36,6 +36,20 @@ class CodeUnitTest(CoverageTest):
self.assertEqual(bcu[0].source_file().read(), "# bfile.py\n")
self.assertEqual(ccu[0].source_file().read(), "# cfile.py\n")
+ def test_odd_filenames(self):
+ acu = code_unit_factory("aa/afile.odd.py", FileLocator())
+ bcu = code_unit_factory("aa/bb/bfile.odd.py", FileLocator())
+ b2cu = code_unit_factory("aa/bb.odd/bfile.py", FileLocator())
+ self.assertEqual(acu[0].name, "aa/afile.odd")
+ self.assertEqual(bcu[0].name, "aa/bb/bfile.odd")
+ self.assertEqual(b2cu[0].name, "aa/bb.odd/bfile")
+ self.assertEqual(acu[0].flat_rootname(), "aa_afile_odd")
+ self.assertEqual(bcu[0].flat_rootname(), "aa_bb_bfile_odd")
+ self.assertEqual(b2cu[0].flat_rootname(), "aa_bb_odd_bfile")
+ self.assertEqual(acu[0].source_file().read(), "# afile.odd.py\n")
+ self.assertEqual(bcu[0].source_file().read(), "# bfile.odd.py\n")
+ self.assertEqual(b2cu[0].source_file().read(), "# bfile.py\n")
+
def test_modules(self):
import aa, aa.bb, aa.bb.cc
cu = code_unit_factory([aa, aa.bb, aa.bb.cc], FileLocator())