diff options
-rw-r--r-- | tests/test_git_command.py | 10 | ||||
-rw-r--r-- | tests/test_manifest_xml.py | 28 | ||||
-rw-r--r-- | tests/test_project.py | 2 |
3 files changed, 20 insertions, 20 deletions
diff --git a/tests/test_git_command.py b/tests/test_git_command.py index aaf21219..ff0d395d 100644 --- a/tests/test_git_command.py +++ b/tests/test_git_command.py | |||
@@ -42,21 +42,21 @@ class GitCommandTest(unittest.TestCase): | |||
42 | 42 | ||
43 | def test_alternative_setting_when_matching(self): | 43 | def test_alternative_setting_when_matching(self): |
44 | r = git_command._build_env( | 44 | r = git_command._build_env( |
45 | objdir = 'zap/objects', | 45 | objdir = os.path.join('zap', 'objects'), |
46 | gitdir = 'zap' | 46 | gitdir = 'zap' |
47 | ) | 47 | ) |
48 | 48 | ||
49 | self.assertIsNone(r.get('GIT_ALTERNATE_OBJECT_DIRECTORIES')) | 49 | self.assertIsNone(r.get('GIT_ALTERNATE_OBJECT_DIRECTORIES')) |
50 | self.assertEqual(r.get('GIT_OBJECT_DIRECTORY'), 'zap/objects') | 50 | self.assertEqual(r.get('GIT_OBJECT_DIRECTORY'), os.path.join('zap', 'objects')) |
51 | 51 | ||
52 | def test_alternative_setting_when_different(self): | 52 | def test_alternative_setting_when_different(self): |
53 | r = git_command._build_env( | 53 | r = git_command._build_env( |
54 | objdir = 'wow/objects', | 54 | objdir = os.path.join('wow', 'objects'), |
55 | gitdir = 'zap' | 55 | gitdir = 'zap' |
56 | ) | 56 | ) |
57 | 57 | ||
58 | self.assertEqual(r.get('GIT_ALTERNATE_OBJECT_DIRECTORIES'), 'zap/objects') | 58 | self.assertEqual(r.get('GIT_ALTERNATE_OBJECT_DIRECTORIES'), os.path.join('zap', 'objects')) |
59 | self.assertEqual(r.get('GIT_OBJECT_DIRECTORY'), 'wow/objects') | 59 | self.assertEqual(r.get('GIT_OBJECT_DIRECTORY'), os.path.join('wow', 'objects')) |
60 | 60 | ||
61 | 61 | ||
62 | class GitCallUnitTest(unittest.TestCase): | 62 | class GitCallUnitTest(unittest.TestCase): |
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index f92108e1..0e649a67 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py | |||
@@ -519,22 +519,22 @@ class ProjectElementTests(ManifestParseTestCase): | |||
519 | """) | 519 | """) |
520 | 520 | ||
521 | manifest = parse('a/path/', 'foo') | 521 | manifest = parse('a/path/', 'foo') |
522 | self.assertEqual(manifest.projects[0].gitdir, | 522 | self.assertEqual(os.path.normpath(manifest.projects[0].gitdir), |
523 | os.path.join(self.tempdir, '.repo/projects/foo.git')) | 523 | os.path.join(self.tempdir, '.repo', 'projects', 'foo.git')) |
524 | self.assertEqual(manifest.projects[0].objdir, | 524 | self.assertEqual(os.path.normpath(manifest.projects[0].objdir), |
525 | os.path.join(self.tempdir, '.repo/project-objects/a/path.git')) | 525 | os.path.join(self.tempdir, '.repo', 'project-objects', 'a', 'path.git')) |
526 | 526 | ||
527 | manifest = parse('a/path', 'foo/') | 527 | manifest = parse('a/path', 'foo/') |
528 | self.assertEqual(manifest.projects[0].gitdir, | 528 | self.assertEqual(os.path.normpath(manifest.projects[0].gitdir), |
529 | os.path.join(self.tempdir, '.repo/projects/foo.git')) | 529 | os.path.join(self.tempdir, '.repo', 'projects', 'foo.git')) |
530 | self.assertEqual(manifest.projects[0].objdir, | 530 | self.assertEqual(os.path.normpath(manifest.projects[0].objdir), |
531 | os.path.join(self.tempdir, '.repo/project-objects/a/path.git')) | 531 | os.path.join(self.tempdir, '.repo', 'project-objects', 'a', 'path.git')) |
532 | 532 | ||
533 | manifest = parse('a/path', 'foo//////') | 533 | manifest = parse('a/path', 'foo//////') |
534 | self.assertEqual(manifest.projects[0].gitdir, | 534 | self.assertEqual(os.path.normpath(manifest.projects[0].gitdir), |
535 | os.path.join(self.tempdir, '.repo/projects/foo.git')) | 535 | os.path.join(self.tempdir, '.repo', 'projects', 'foo.git')) |
536 | self.assertEqual(manifest.projects[0].objdir, | 536 | self.assertEqual(os.path.normpath(manifest.projects[0].objdir), |
537 | os.path.join(self.tempdir, '.repo/project-objects/a/path.git')) | 537 | os.path.join(self.tempdir, '.repo', 'project-objects', 'a', 'path.git')) |
538 | 538 | ||
539 | def test_toplevel_path(self): | 539 | def test_toplevel_path(self): |
540 | """Check handling of path=. specially.""" | 540 | """Check handling of path=. specially.""" |
@@ -551,8 +551,8 @@ class ProjectElementTests(ManifestParseTestCase): | |||
551 | 551 | ||
552 | for path in ('.', './', './/', './//'): | 552 | for path in ('.', './', './/', './//'): |
553 | manifest = parse('server/path', path) | 553 | manifest = parse('server/path', path) |
554 | self.assertEqual(manifest.projects[0].gitdir, | 554 | self.assertEqual(os.path.normpath(manifest.projects[0].gitdir), |
555 | os.path.join(self.tempdir, '.repo/projects/..git')) | 555 | os.path.join(self.tempdir, '.repo', 'projects', '..git')) |
556 | 556 | ||
557 | def test_bad_path_name_checks(self): | 557 | def test_bad_path_name_checks(self): |
558 | """Check handling of bad path & name attributes.""" | 558 | """Check handling of bad path & name attributes.""" |
diff --git a/tests/test_project.py b/tests/test_project.py index 5c600be7..47018d1c 100644 --- a/tests/test_project.py +++ b/tests/test_project.py | |||
@@ -384,7 +384,7 @@ class MigrateWorkTreeTests(unittest.TestCase): | |||
384 | 384 | ||
385 | # Make sure the dir was transformed into a symlink. | 385 | # Make sure the dir was transformed into a symlink. |
386 | self.assertTrue(dotgit.is_symlink()) | 386 | self.assertTrue(dotgit.is_symlink()) |
387 | self.assertEqual(os.readlink(dotgit), '../../.repo/projects/src/test.git') | 387 | self.assertEqual(os.readlink(dotgit), os.path.normpath('../../.repo/projects/src/test.git')) |
388 | 388 | ||
389 | # Make sure files were moved over. | 389 | # Make sure files were moved over. |
390 | gitdir = tempdir / '.repo/projects/src/test.git' | 390 | gitdir = tempdir / '.repo/projects/src/test.git' |