| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 75ba2c3 commit f0ee0d3
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,11 +16,10 @@ | |||
| 16 | 16 | ||
| 17 | 17 | from git.objects import Blob, Tree | |
| 18 | 18 | from git.objects.tree import TreeModifier | |
| 19 | - from git.repo import Repo | ||
| 20 | 19 | from git.util import cwd | |
| 21 | 20 | from test.lib import TestBase, with_rw_directory | |
| 22 | 21 | ||
| 23 | - from .lib.helper import PathLikeMock, with_rw_repo | ||
| 22 | + from .lib.helper import PathLikeMock | ||
| 24 | 23 | ||
| 25 | 24 | ||
| 26 | 25 | @ddt.ddt | |
@@ -198,56 +197,48 @@ def lib_folder(t, _d): | |||
| 198 | 197 | # END for each item | |
| 199 | 198 | assert found_slash | |
| 200 | 199 | ||
| 201 | - @with_rw_repo("0.3.2.1") | ||
| 202 | - def test_repo_lookup_string_path(self, rw_repo): | ||
| 203 | - repo = Repo(rw_repo.git_dir) | ||
| 204 | - blob = repo.tree() / ".gitignore" | ||
| 200 | + def test_repo_lookup_string_path(self): | ||
| 201 | + tree = self.rorepo.tree("0.3.2.1") | ||
| 202 | + blob = tree / ".gitignore" | ||
| 205 | 203 | assert isinstance(blob, Blob) | |
| 206 | 204 | assert blob.hexsha == "787b3d442a113b78e343deb585ab5531eb7187fa" | |
| 207 | 205 | ||
| 208 | - @with_rw_repo("0.3.2.1") | ||
| 209 | - def test_repo_lookup_pathlike_path(self, rw_repo): | ||
| 210 | - repo = Repo(rw_repo.git_dir) | ||
| 211 | - blob = repo.tree() / PathLikeMock(".gitignore") | ||
| 206 | + def test_repo_lookup_pathlike_path(self): | ||
| 207 | + tree = self.rorepo.tree("0.3.2.1") | ||
| 208 | + blob = tree / PathLikeMock(".gitignore") | ||
| 212 | 209 | assert isinstance(blob, Blob) | |
| 213 | 210 | assert blob.hexsha == "787b3d442a113b78e343deb585ab5531eb7187fa" | |
| 214 | 211 | ||
| 215 | - @with_rw_repo("0.3.2.1") | ||
| 216 | - def test_repo_lookup_invalid_string_path(self, rw_repo): | ||
| 217 | - repo = Repo(rw_repo.git_dir) | ||
| 212 | + def test_repo_lookup_invalid_string_path(self): | ||
| 213 | + tree = self.rorepo.tree("0.3.2.1") | ||
| 218 | 214 | with pytest.raises(KeyError): | |
| 219 | - repo.tree() / "doesnotexist" | ||
| 215 | + tree / "doesnotexist" | ||
| 220 | 216 | ||
| 221 | - @with_rw_repo("0.3.2.1") | ||
| 222 | - def test_repo_lookup_invalid_pathlike_path(self, rw_repo): | ||
| 223 | - repo = Repo(rw_repo.git_dir) | ||
| 217 | + def test_repo_lookup_invalid_pathlike_path(self): | ||
| 218 | + tree = self.rorepo.tree("0.3.2.1") | ||
| 224 | 219 | with pytest.raises(KeyError): | |
| 225 | - repo.tree() / PathLikeMock("doesnotexist") | ||
| 220 | + tree / PathLikeMock("doesnotexist") | ||
| 226 | 221 | ||
| 227 | - @with_rw_repo("0.3.2.1") | ||
| 228 | - def test_repo_lookup_nested_string_path(self, rw_repo): | ||
| 229 | - repo = Repo(rw_repo.git_dir) | ||
| 230 | - blob = repo.tree() / "git/__init__.py" | ||
| 222 | + def test_repo_lookup_nested_string_path(self): | ||
| 223 | + tree = self.rorepo.tree("0.3.2.1") | ||
| 224 | + blob = tree / "git/__init__.py" | ||
| 231 | 225 | assert isinstance(blob, Blob) | |
| 232 | 226 | assert blob.hexsha == "d87dcbdbb65d2782e14eea27e7f833a209c052f3" | |
| 233 | 227 | ||
| 234 | - @with_rw_repo("0.3.2.1") | ||
| 235 | - def test_repo_lookup_nested_pathlike_path(self, rw_repo): | ||
| 236 | - repo = Repo(rw_repo.git_dir) | ||
| 237 | - blob = repo.tree() / PathLikeMock("git/__init__.py") | ||
| 228 | + def test_repo_lookup_nested_pathlike_path(self): | ||
| 229 | + tree = self.rorepo.tree("0.3.2.1") | ||
| 230 | + blob = tree / PathLikeMock("git/__init__.py") | ||
| 238 | 231 | assert isinstance(blob, Blob) | |
| 239 | 232 | assert blob.hexsha == "d87dcbdbb65d2782e14eea27e7f833a209c052f3" | |
| 240 | 233 | ||
| 241 | - @with_rw_repo("0.3.2.1") | ||
| 242 | - def test_repo_lookup_folder_string_path(self, rw_repo): | ||
| 243 | - repo = Repo(rw_repo.git_dir) | ||
| 244 | - tree = repo.tree() / "git" | ||
| 234 | + def test_repo_lookup_folder_string_path(self): | ||
| 235 | + tree = self.rorepo.tree("0.3.2.1") | ||
| 236 | + tree = tree / "git" | ||
| 245 | 237 | assert isinstance(tree, Tree) | |
| 246 | 238 | assert tree.hexsha == "ec8ae429156d65afde4bbb3455570193b56f0977" | |
| 247 | 239 | ||
| 248 | - @with_rw_repo("0.3.2.1") | ||
| 249 | - def test_repo_lookup_folder_pathlike_path(self, rw_repo): | ||
| 250 | - repo = Repo(rw_repo.git_dir) | ||
| 251 | - tree = repo.tree() / PathLikeMock("git") | ||
| 240 | + def test_repo_lookup_folder_pathlike_path(self): | ||
| 241 | + tree = self.rorepo.tree("0.3.2.1") | ||
| 242 | + tree = tree / PathLikeMock("git") | ||
| 252 | 243 | assert isinstance(tree, Tree) | |
| 253 | 244 | assert tree.hexsha == "ec8ae429156d65afde4bbb3455570193b56f0977" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments