diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/fixtures/gitc_config | 1 | ||||
| -rw-r--r-- | tests/test_wrapper.py | 75 |
2 files changed, 1 insertions, 75 deletions
diff --git a/tests/fixtures/gitc_config b/tests/fixtures/gitc_config deleted file mode 100644 index a7f3d1c9..00000000 --- a/tests/fixtures/gitc_config +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | gitc_dir=/test/usr/local/google/gitc | ||
diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index ea7a8b4d..8bebdf80 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py | |||
| @@ -72,84 +72,11 @@ class RepoWrapperUnitTest(RepoWrapperTestCase): | |||
| 72 | 72 | ||
| 73 | def test_init_parser(self): | 73 | def test_init_parser(self): |
| 74 | """Make sure 'init' GetParser works.""" | 74 | """Make sure 'init' GetParser works.""" |
| 75 | parser = self.wrapper.GetParser(gitc_init=False) | 75 | parser = self.wrapper.GetParser() |
| 76 | opts, args = parser.parse_args([]) | 76 | opts, args = parser.parse_args([]) |
| 77 | self.assertEqual([], args) | 77 | self.assertEqual([], args) |
| 78 | self.assertIsNone(opts.manifest_url) | 78 | self.assertIsNone(opts.manifest_url) |
| 79 | 79 | ||
| 80 | def test_gitc_init_parser(self): | ||
| 81 | """Make sure 'gitc-init' GetParser raises.""" | ||
| 82 | with self.assertRaises(SystemExit): | ||
| 83 | self.wrapper.GetParser(gitc_init=True) | ||
| 84 | |||
| 85 | def test_get_gitc_manifest_dir_no_gitc(self): | ||
| 86 | """ | ||
| 87 | Test reading a missing gitc config file | ||
| 88 | """ | ||
| 89 | self.wrapper.GITC_CONFIG_FILE = fixture("missing_gitc_config") | ||
| 90 | val = self.wrapper.get_gitc_manifest_dir() | ||
| 91 | self.assertEqual(val, "") | ||
| 92 | |||
| 93 | def test_get_gitc_manifest_dir(self): | ||
| 94 | """ | ||
| 95 | Test reading the gitc config file and parsing the directory | ||
| 96 | """ | ||
| 97 | self.wrapper.GITC_CONFIG_FILE = fixture("gitc_config") | ||
| 98 | val = self.wrapper.get_gitc_manifest_dir() | ||
| 99 | self.assertEqual(val, "/test/usr/local/google/gitc") | ||
| 100 | |||
| 101 | def test_gitc_parse_clientdir_no_gitc(self): | ||
| 102 | """ | ||
| 103 | Test parsing the gitc clientdir without gitc running | ||
| 104 | """ | ||
| 105 | self.wrapper.GITC_CONFIG_FILE = fixture("missing_gitc_config") | ||
| 106 | self.assertEqual(self.wrapper.gitc_parse_clientdir("/something"), None) | ||
| 107 | self.assertEqual( | ||
| 108 | self.wrapper.gitc_parse_clientdir("/gitc/manifest-rw/test"), "test" | ||
| 109 | ) | ||
| 110 | |||
| 111 | def test_gitc_parse_clientdir(self): | ||
| 112 | """ | ||
| 113 | Test parsing the gitc clientdir | ||
| 114 | """ | ||
| 115 | self.wrapper.GITC_CONFIG_FILE = fixture("gitc_config") | ||
| 116 | self.assertEqual(self.wrapper.gitc_parse_clientdir("/something"), None) | ||
| 117 | self.assertEqual( | ||
| 118 | self.wrapper.gitc_parse_clientdir("/gitc/manifest-rw/test"), "test" | ||
| 119 | ) | ||
| 120 | self.assertEqual( | ||
| 121 | self.wrapper.gitc_parse_clientdir("/gitc/manifest-rw/test/"), "test" | ||
| 122 | ) | ||
| 123 | self.assertEqual( | ||
| 124 | self.wrapper.gitc_parse_clientdir("/gitc/manifest-rw/test/extra"), | ||
| 125 | "test", | ||
| 126 | ) | ||
| 127 | self.assertEqual( | ||
| 128 | self.wrapper.gitc_parse_clientdir( | ||
| 129 | "/test/usr/local/google/gitc/test" | ||
| 130 | ), | ||
| 131 | "test", | ||
| 132 | ) | ||
| 133 | self.assertEqual( | ||
| 134 | self.wrapper.gitc_parse_clientdir( | ||
| 135 | "/test/usr/local/google/gitc/test/" | ||
| 136 | ), | ||
| 137 | "test", | ||
| 138 | ) | ||
| 139 | self.assertEqual( | ||
| 140 | self.wrapper.gitc_parse_clientdir( | ||
| 141 | "/test/usr/local/google/gitc/test/extra" | ||
| 142 | ), | ||
| 143 | "test", | ||
| 144 | ) | ||
| 145 | self.assertEqual( | ||
| 146 | self.wrapper.gitc_parse_clientdir("/gitc/manifest-rw/"), None | ||
| 147 | ) | ||
| 148 | self.assertEqual( | ||
| 149 | self.wrapper.gitc_parse_clientdir("/test/usr/local/google/gitc/"), | ||
| 150 | None, | ||
| 151 | ) | ||
| 152 | |||
| 153 | 80 | ||
| 154 | class SetGitTrace2ParentSid(RepoWrapperTestCase): | 81 | class SetGitTrace2ParentSid(RepoWrapperTestCase): |
| 155 | """Check SetGitTrace2ParentSid behavior.""" | 82 | """Check SetGitTrace2ParentSid behavior.""" |
