mirror of
https://github.com/Dev-Wiki/git-repo.git
synced 2025-12-16 03:10:28 +08:00
test: fix path seperator errors on windows
Fixing multiple errors when running tests on Windows related
to path seperator being different ('\' instead of '/').
Signed-off-by: Daniel Kutik <daniel.kutik@lavawerk.com>
Change-Id: I26b44d092b925edecab46a4d88e77dd9dcb8df28
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/353178
Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
@@ -519,22 +519,22 @@ class ProjectElementTests(ManifestParseTestCase):
|
||||
""")
|
||||
|
||||
manifest = parse('a/path/', 'foo')
|
||||
self.assertEqual(manifest.projects[0].gitdir,
|
||||
os.path.join(self.tempdir, '.repo/projects/foo.git'))
|
||||
self.assertEqual(manifest.projects[0].objdir,
|
||||
os.path.join(self.tempdir, '.repo/project-objects/a/path.git'))
|
||||
self.assertEqual(os.path.normpath(manifest.projects[0].gitdir),
|
||||
os.path.join(self.tempdir, '.repo', 'projects', 'foo.git'))
|
||||
self.assertEqual(os.path.normpath(manifest.projects[0].objdir),
|
||||
os.path.join(self.tempdir, '.repo', 'project-objects', 'a', 'path.git'))
|
||||
|
||||
manifest = parse('a/path', 'foo/')
|
||||
self.assertEqual(manifest.projects[0].gitdir,
|
||||
os.path.join(self.tempdir, '.repo/projects/foo.git'))
|
||||
self.assertEqual(manifest.projects[0].objdir,
|
||||
os.path.join(self.tempdir, '.repo/project-objects/a/path.git'))
|
||||
self.assertEqual(os.path.normpath(manifest.projects[0].gitdir),
|
||||
os.path.join(self.tempdir, '.repo', 'projects', 'foo.git'))
|
||||
self.assertEqual(os.path.normpath(manifest.projects[0].objdir),
|
||||
os.path.join(self.tempdir, '.repo', 'project-objects', 'a', 'path.git'))
|
||||
|
||||
manifest = parse('a/path', 'foo//////')
|
||||
self.assertEqual(manifest.projects[0].gitdir,
|
||||
os.path.join(self.tempdir, '.repo/projects/foo.git'))
|
||||
self.assertEqual(manifest.projects[0].objdir,
|
||||
os.path.join(self.tempdir, '.repo/project-objects/a/path.git'))
|
||||
self.assertEqual(os.path.normpath(manifest.projects[0].gitdir),
|
||||
os.path.join(self.tempdir, '.repo', 'projects', 'foo.git'))
|
||||
self.assertEqual(os.path.normpath(manifest.projects[0].objdir),
|
||||
os.path.join(self.tempdir, '.repo', 'project-objects', 'a', 'path.git'))
|
||||
|
||||
def test_toplevel_path(self):
|
||||
"""Check handling of path=. specially."""
|
||||
@@ -551,8 +551,8 @@ class ProjectElementTests(ManifestParseTestCase):
|
||||
|
||||
for path in ('.', './', './/', './//'):
|
||||
manifest = parse('server/path', path)
|
||||
self.assertEqual(manifest.projects[0].gitdir,
|
||||
os.path.join(self.tempdir, '.repo/projects/..git'))
|
||||
self.assertEqual(os.path.normpath(manifest.projects[0].gitdir),
|
||||
os.path.join(self.tempdir, '.repo', 'projects', '..git'))
|
||||
|
||||
def test_bad_path_name_checks(self):
|
||||
"""Check handling of bad path & name attributes."""
|
||||
|
||||
Reference in New Issue
Block a user