Convert '.' and '..' to the less magical os.curdir and os.pardir

While I'm cleaning up path manipulation, I might as well make things
more semantic.
This commit is contained in:
W. Trevor King 2013-03-11 08:25:47 -04:00
commit b59da89e80
10 changed files with 19 additions and 16 deletions

View file

@ -71,9 +71,9 @@ class TestUtils(LoggedTestCase):
def test_get_relative_path(self):
samples = (('test/test.html', '..'),
('test/test/test.html', '../..'),
('test.html', '.'))
samples = (('test/test.html', os.pardir),
('test/test/test.html', os.path.join(os.pardir, os.pardir)),
('test.html', os.curdir))
for value, expected in samples:
self.assertEquals(utils.get_relative_path(value), expected)