From 8dcb7573a2c3a469b2182831dc98fbb693fe0f6d Mon Sep 17 00:00:00 2001 From: JPeterMugaas Date: Wed, 4 Nov 2020 13:02:50 -0500 Subject: Fix tests to handle paths in Windows. NormalizePath works properly but the tests would still fail because NormalizePath would NOT work as the test results expected. --- testsuite/test_shell.py | 2 +- testsuite/test_util.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/test_shell.py b/testsuite/test_shell.py index 3878194..059d882 100644 --- a/testsuite/test_shell.py +++ b/testsuite/test_shell.py @@ -79,7 +79,7 @@ class ShellTestCase(unittest.TestCase): self.assertFalse(stderr) self.assertEqual(len(stdout), 24) for line, num, col in zip(stdout, (3, 6, 6, 9, 12), (3, 6, 6, 1, 5)): - path, x, y, msg = line.split(':') + path, x, y, msg = line.rsplit(':', 3) self.assertTrue(path.endswith(E11)) self.assertEqual(x, str(num)) self.assertEqual(y, str(col)) diff --git a/testsuite/test_util.py b/testsuite/test_util.py index 8eaba7e..7eff16a 100644 --- a/testsuite/test_util.py +++ b/testsuite/test_util.py @@ -18,6 +18,6 @@ class UtilTestCase(unittest.TestCase): self.assertEqual(normalize_paths('foo,bar'), ['foo', 'bar']) self.assertEqual(normalize_paths('foo, bar '), ['foo', 'bar']) self.assertEqual(normalize_paths('/foo/bar,baz/../bat'), - ['/foo/bar', cwd + '/bat']) + [os.path.realpath('/foo/bar'), cwd + '/bat']) self.assertEqual(normalize_paths(".pyc,\n build/*"), ['.pyc', cwd + '/build/*']) -- cgit v1.2.1