summaryrefslogtreecommitdiff
path: root/test/test_codeunit.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-07-08 09:24:20 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-07-08 09:24:20 -0400
commitd3edb493b6cafd26e7881d5dc86b00bda471dc94 (patch)
tree83c45aa5f73f2db728a00cd4065d0b30e9aefc5e /test/test_codeunit.py
parent45f101480589b553394319af4faad34aa6fe069f (diff)
downloadpython-coveragepy-git-d3edb493b6cafd26e7881d5dc86b00bda471dc94.tar.gz
Various Py3k fixes: remove gratuitous print, don't test the print statement, deal with __cmp__ ugliness, etc.
Diffstat (limited to 'test/test_codeunit.py')
-rw-r--r--test/test_codeunit.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_codeunit.py b/test/test_codeunit.py
index d03ff8d9..46853b76 100644
--- a/test/test_codeunit.py
+++ b/test/test_codeunit.py
@@ -58,3 +58,14 @@ class CodeUnitTest(CoverageTest):
self.assertEqual(cu[0].source_file().read(), "# afile.py\n")
self.assertEqual(cu[1].source_file().read(), "# bfile.py\n")
self.assertEqual(cu[2].source_file().read(), "# cfile.py\n")
+
+ def test_comparison(self):
+ acu = code_unit_factory("aa/afile.py", FileLocator())
+ acu2 = code_unit_factory("aa/afile.py", FileLocator())
+ zcu = code_unit_factory("aa/zfile.py", FileLocator())
+ bcu = code_unit_factory("aa/bb/bfile.py", FileLocator())
+ assert acu == acu2 and acu <= acu2 and acu >= acu2
+ assert acu < zcu and acu <= zcu and acu != zcu
+ 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