|
11 | 11 |
|
12 | 12 | from libvcs import exc |
13 | 13 | from libvcs.cmd.core import run, which |
14 | | -from libvcs.conftest import CreateRepoCallbackFixtureProtocol |
| 14 | +from libvcs.conftest import CreateProjectCallbackFixtureProtocol |
15 | 15 | from libvcs.projects.git import ( |
16 | 16 | GitFullRemoteDict, |
17 | 17 | GitProject, |
|
25 | 25 | pytestmark = pytest.mark.skip(reason="git is not available") |
26 | 26 |
|
27 | 27 |
|
28 | | -RepoTestFactory = Callable[..., GitProject] |
29 | | -RepoTestFactoryLazyKwargs = Callable[..., dict] |
30 | | -RepoTestFactoryRemotesLazyExpected = Callable[..., GitFullRemoteDict] |
| 28 | +ProjectTestFactory = Callable[..., GitProject] |
| 29 | +ProjectTestFactoryLazyKwargs = Callable[..., dict] |
| 30 | +ProjectTestFactoryRemotesLazyExpected = Callable[..., GitFullRemoteDict] |
31 | 31 |
|
32 | 32 |
|
33 | 33 | @pytest.mark.parametrize( |
|
52 | 52 | ) |
53 | 53 | def test_repo_git_obtain_initial_commit_repo( |
54 | 54 | tmp_path: pathlib.Path, |
55 | | - constructor: RepoTestFactory, |
56 | | - lazy_constructor_options: RepoTestFactoryLazyKwargs, |
| 55 | + constructor: ProjectTestFactory, |
| 56 | + lazy_constructor_options: ProjectTestFactoryLazyKwargs, |
57 | 57 | ): |
58 | 58 | """initial commit repos return 'initial'. |
59 | 59 |
|
@@ -94,8 +94,8 @@ def test_repo_git_obtain_initial_commit_repo( |
94 | 94 | def test_repo_git_obtain_full( |
95 | 95 | tmp_path: pathlib.Path, |
96 | 96 | git_remote_repo, |
97 | | - constructor: RepoTestFactory, |
98 | | - lazy_constructor_options: RepoTestFactoryLazyKwargs, |
| 97 | + constructor: ProjectTestFactory, |
| 98 | + lazy_constructor_options: ProjectTestFactoryLazyKwargs, |
99 | 99 | ): |
100 | 100 | git_repo: GitProject = constructor(**lazy_constructor_options(**locals())) |
101 | 101 | git_repo.obtain() |
@@ -130,8 +130,8 @@ def test_repo_update_handle_cases( |
130 | 130 | tmp_path: pathlib.Path, |
131 | 131 | git_remote_repo: pathlib.Path, |
132 | 132 | mocker: MockerFixture, |
133 | | - constructor: RepoTestFactory, |
134 | | - lazy_constructor_options: RepoTestFactoryLazyKwargs, |
| 133 | + constructor: ProjectTestFactory, |
| 134 | + lazy_constructor_options: ProjectTestFactoryLazyKwargs, |
135 | 135 | ): |
136 | 136 | git_repo: GitProject = constructor(**lazy_constructor_options(**locals())) |
137 | 137 | git_repo.obtain() # clone initial repo |
@@ -174,8 +174,8 @@ def test_progress_callback( |
174 | 174 | tmp_path: pathlib.Path, |
175 | 175 | git_remote_repo: pathlib.Path, |
176 | 176 | mocker: MockerFixture, |
177 | | - constructor: RepoTestFactory, |
178 | | - lazy_constructor_options: RepoTestFactoryLazyKwargs, |
| 177 | + constructor: ProjectTestFactory, |
| 178 | + lazy_constructor_options: ProjectTestFactoryLazyKwargs, |
179 | 179 | ): |
180 | 180 | def progress_callback_spy(output, timestamp): |
181 | 181 | assert isinstance(output, str) |
@@ -297,9 +297,9 @@ def progress_callback_spy(output, timestamp): |
297 | 297 | def test_remotes( |
298 | 298 | projects_path: pathlib.Path, |
299 | 299 | git_remote_repo: pathlib.Path, |
300 | | - constructor: RepoTestFactory, |
301 | | - lazy_constructor_options: RepoTestFactoryLazyKwargs, |
302 | | - lazy_remote_expected: RepoTestFactoryRemotesLazyExpected, |
| 300 | + constructor: ProjectTestFactory, |
| 301 | + lazy_constructor_options: ProjectTestFactoryLazyKwargs, |
| 302 | + lazy_remote_expected: ProjectTestFactoryRemotesLazyExpected, |
303 | 303 | ): |
304 | 304 | repo_name = "myrepo" |
305 | 305 | remote_name = "myremote" |
@@ -409,11 +409,11 @@ def test_remotes( |
409 | 409 | def test_remotes_update_repo( |
410 | 410 | projects_path: pathlib.Path, |
411 | 411 | git_remote_repo: pathlib.Path, |
412 | | - constructor: RepoTestFactory, |
413 | | - lazy_constructor_options: RepoTestFactoryLazyKwargs, |
414 | | - lazy_remote_dict: RepoTestFactoryRemotesLazyExpected, |
415 | | - lazy_remote_expected: RepoTestFactoryRemotesLazyExpected, |
416 | | - create_git_remote_repo: CreateRepoCallbackFixtureProtocol, |
| 412 | + constructor: ProjectTestFactory, |
| 413 | + lazy_constructor_options: ProjectTestFactoryLazyKwargs, |
| 414 | + lazy_remote_dict: ProjectTestFactoryRemotesLazyExpected, |
| 415 | + lazy_remote_expected: ProjectTestFactoryRemotesLazyExpected, |
| 416 | + create_git_remote_repo: CreateProjectCallbackFixtureProtocol, |
417 | 417 | ): |
418 | 418 | repo_name = "myrepo" |
419 | 419 | remote_name = "myremote" |
@@ -479,8 +479,8 @@ def test_git_get_url_and_rev_from_pip_url(): |
479 | 479 | def test_remotes_preserves_git_ssh( |
480 | 480 | projects_path: pathlib.Path, |
481 | 481 | git_remote_repo: pathlib.Path, |
482 | | - constructor: RepoTestFactory, |
483 | | - lazy_constructor_options: RepoTestFactoryLazyKwargs, |
| 482 | + constructor: ProjectTestFactory, |
| 483 | + lazy_constructor_options: ProjectTestFactoryLazyKwargs, |
484 | 484 | ): |
485 | 485 | # Regression test for #14 |
486 | 486 | repo_name = "myexamplegit" |
@@ -520,8 +520,8 @@ def test_remotes_preserves_git_ssh( |
520 | 520 | ) |
521 | 521 | def test_private_ssh_format( |
522 | 522 | tmpdir: pathlib.Path, |
523 | | - constructor: RepoTestFactory, |
524 | | - lazy_constructor_options: RepoTestFactoryLazyKwargs, |
| 523 | + constructor: ProjectTestFactory, |
| 524 | + lazy_constructor_options: ProjectTestFactoryLazyKwargs, |
525 | 525 | ): |
526 | 526 | pip_url_kwargs = { |
527 | 527 | "pip_url": "git+ssh://github.com:/tmp/omg/private_ssh_repo", |
@@ -729,7 +729,7 @@ def test_extract_status_c(fixture: str, expected_result: dict): |
729 | 729 |
|
730 | 730 |
|
731 | 731 | def test_repo_git_remote_checkout( |
732 | | - create_git_remote_repo: CreateRepoCallbackFixtureProtocol, |
| 732 | + create_git_remote_repo: CreateProjectCallbackFixtureProtocol, |
733 | 733 | tmp_path: pathlib.Path, |
734 | 734 | projects_path: pathlib.Path, |
735 | 735 | ): |
|
0 commit comments