diff options
author | Jason Pellerin <jpellerin@gmail.com> | 2007-12-22 19:00:22 +0000 |
---|---|---|
committer | Jason Pellerin <jpellerin@gmail.com> | 2007-12-22 19:00:22 +0000 |
commit | 1e9e1fb6aa3a178c53ad2a29ae626926125b300f (patch) | |
tree | 9401df6aea062f37fb6d4bb61222513adf2c8ce3 /unit_tests/test_utils.py | |
parent | cd3bb6ede7025e1ed24d7a01f68533b5c5c225f6 (diff) | |
download | nose-1e9e1fb6aa3a178c53ad2a29ae626926125b300f.tar.gz |
MERGED 0.10.0-stable 378:411 to trunk in preparation for 0.10.1 release.
Diffstat (limited to 'unit_tests/test_utils.py')
-rw-r--r-- | unit_tests/test_utils.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/unit_tests/test_utils.py b/unit_tests/test_utils.py index ad01e25..f982cc2 100644 --- a/unit_tests/test_utils.py +++ b/unit_tests/test_utils.py @@ -1,9 +1,12 @@ +import os import unittest import nose from nose import case # don't import * -- some util functions look testlike from nose import util +np = os.path.normpath + class TestUtils(unittest.TestCase): def test_file_like(self): @@ -23,29 +26,31 @@ class TestUtils(unittest.TestCase): assert split_test_name('some.module') == \ (None, 'some.module', None) assert split_test_name('this/file.py:func') == \ - ('this/file.py', None, 'func') + (np('this/file.py'), None, 'func') assert split_test_name('some/file.py') == \ - ('some/file.py', None, None) + (np('some/file.py'), None, None) assert split_test_name(':Baz') == \ (None, None, 'Baz') + assert split_test_name('foo:bar/baz.py') == \ + (np('foo:bar/baz.py'), None, None) def test_split_test_name_windows(self): # convenience stn = util.split_test_name self.assertEqual(stn(r'c:\some\path.py:a_test'), - (r'c:\some\path.py', None, 'a_test')) + (np(r'c:\some\path.py'), None, 'a_test')) self.assertEqual(stn(r'c:\some\path.py'), - (r'c:\some\path.py', None, None)) + (np(r'c:\some\path.py'), None, None)) self.assertEqual(stn(r'c:/some/other/path.py'), - (r'c:/some/other/path.py', None, None)) + (np(r'c:/some/other/path.py'), None, None)) self.assertEqual(stn(r'c:/some/other/path.py:Class.test'), - (r'c:/some/other/path.py', None, 'Class.test')) + (np(r'c:/some/other/path.py'), None, 'Class.test')) try: - stn('c:something') + stn('cat:dog:something') except ValueError: pass else: - self.fail("Ambiguous test name should throw ValueError") + self.fail("Nonsense test name should throw ValueError") def test_test_address(self): # test addresses are specified as |