summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2020-01-15 15:47:08 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2020-01-16 12:20:06 +0800
commitb24cddcaea6e635651beabbc96ca0cced8d6e266 (patch)
treead95e2e950fd31bf8856d614a6b0caa24e757404
parentd14923f6c52e4747658c1b58766103fe6c207b40 (diff)
downloadgobject-introspection-b24cddcaea6e635651beabbc96ca0cced8d6e266.tar.gz
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.
-rw-r--r--tests/scanner/test_scanner.py5
1 files 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, [])