From d9254599f9bb47632313ecb90c5f281ceca5da3a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 19 Feb 2020 22:36:26 -0500 Subject: manifest/tests: get them passing under Windows We also need to check more things in the manifest/project handlers, and use platform_utils in a few places to address Windows behavior. Drop Python 2.7 from Windows testing as it definitely doesn't work and we won't be fixing it. Change-Id: I83d00ee9f1612312bb3f7147cb9535fc61268245 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256113 Tested-by: Mike Frysinger Reviewed-by: Jonathan Nieder Reviewed-by: David Pursehouse --- tests/test_manifest_xml.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/test_manifest_xml.py') diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index b6ec5b86..1cb72971 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py @@ -18,6 +18,7 @@ from __future__ import print_function +import os import unittest import error @@ -78,6 +79,11 @@ class ManifestValidateFilePaths(unittest.TestCase): # Block Unicode characters that get normalized out by filesystems. u'foo\u200Cbar', ) + # Make sure platforms that use path separators (e.g. Windows) are also + # rejected properly. + if os.path.sep != '/': + PATHS += tuple(x.replace('/', os.path.sep) for x in PATHS) + for path in PATHS: self.assertRaises( error.ManifestInvalidPathError, self.check_both, path, 'a') -- cgit v1.2.3-54-g00ecf