[gobject-introspection/py38.windows] test_scanner.py: Fix path tests on Windows
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/py38.windows] test_scanner.py: Fix path tests on Windows
- Date: Wed, 15 Jan 2020 10:15:21 +0000 (UTC)
commit 80d5c03be08ba321b1c2eeb06fbea6feccf0567e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jan 15 15:47:08 2020 +0800
test_scanner.py: Fix path tests on Windows
We may get drive letters and paths either in upper or lower cases
in Windows, which are actually no different. Ignore the cases
in this case.
tests/scanner/test_scanner.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/tests/scanner/test_scanner.py b/tests/scanner/test_scanner.py
index 85953964..91c120f1 100644
--- a/tests/scanner/test_scanner.py
+++ b/tests/scanner/test_scanner.py
@@ -12,7 +12,8 @@ class TestScanner(unittest.TestCase):
paths = get_source_root_dirs(options, ["nope"])
self.assertEqual(len(paths), 1)
self.assertTrue(os.path.isabs(paths[0]))
- self.assertEqual(paths[0], os.path.join(os.getcwd(), "foo"))
+ self.assertEqual(os.path.normcase(paths[0]),
+ os.path.normcase(os.path.join(os.getcwd(), "foo")))
def test_get_source_root_dirs_guess(self):
options = optparse.Values({"sources_top_dirs": []})
@@ -20,7 +21,7 @@ class TestScanner(unittest.TestCase):
paths = get_source_root_dirs(
options, [os.path.join(cwd, "foo"), os.path.join(cwd, "bar")])
self.assertEqual(len(paths), 1)
- self.assertEqual(paths[0], cwd)
+ self.assertEqual(os.path.normcase(paths[0]), os.path.normcase(cwd))
paths = get_source_root_dirs(options, [])
self.assertEqual(paths, [])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]