diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2023-01-17 17:20:12 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2023-01-17 17:20:12 +0000 |
| commit | db4031b247646f29c744859540c23f7bb097510d (patch) | |
| tree | 6ed9700c4a8bcf39df3e2c485156d53fe0056692 /docutils/test | |
| parent | f88c02212ed484500c451fd30e58d000f777bfac (diff) | |
| download | docutils-db4031b247646f29c744859540c23f7bb097510d.tar.gz | |
Fix test case under Windows, add HISTORY entry for last commit.
Thanks to Alan Isaac for test and report.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9323 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test')
| -rwxr-xr-x | docutils/test/test_utils.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/docutils/test/test_utils.py b/docutils/test/test_utils.py index 70d5316fd..c7a44f78e 100755 --- a/docutils/test/test_utils.py +++ b/docutils/test/test_utils.py @@ -351,15 +351,16 @@ class HelperFunctionTests(unittest.TestCase): dirs = (os.path.join(TEST_ROOT, 'nonex'), TEST_ROOT, os.path.join(TEST_ROOT, '..')) - found = utils.find_file_in_dirs('HISTORY.txt', dirs) - self.assertEqual(found, (TEST_ROOT / '..' / 'HISTORY.txt').as_posix()) - # normalize - found = os.path.relpath(found, TEST_ROOT).replace('\\', '/') - self.assertTrue(found.startswith('..'), + result = utils.find_file_in_dirs('alltests.py', dirs) + expected = os.path.join(TEST_ROOT, 'alltests.py').replace('\\', '/') + self.assertEqual(result, expected) + result = utils.find_file_in_dirs('HISTORY.txt', dirs) + expected = (TEST_ROOT / '..' / 'HISTORY.txt').as_posix() + self.assertEqual(result, expected) + # normalize for second check + self.assertTrue(os.path.relpath(result, TEST_ROOT).startswith('..'), 'HISTORY.txt not found in "..".') # Return `path` if the file exists in the cwd or if there is no match - self.assertEqual(utils.find_file_in_dirs('alltests.py', dirs), - os.path.join(TEST_ROOT, 'alltests.py')) self.assertEqual(utils.find_file_in_dirs('gibts/nicht.txt', dirs), 'gibts/nicht.txt') |
