feat: add git pull subcommand
Some checks failed
checks / tests-10 (push) Failing after 2m56s
checks / pre-commit (push) Successful in 4m28s
checks / tests-11 (push) Failing after 4m8s
checks / tests-12 (push) Failing after 2m47s

This commit is contained in:
cătălin 2024-09-06 20:51:03 +02:00
commit 9dd2405c47
No known key found for this signature in database
10 changed files with 101 additions and 15 deletions

View file

@ -9,29 +9,30 @@ from halig.commands.git.push import GitPushCommand
@pytest.fixture
def command(settings, faker):
"""Configure a local remote for testing"""
commit_command = GitCommitCommand(settings)
new_path = shutil.copytree(settings.notebooks_root_path , settings.notebooks_root_path / "../remote")
commit_command = GitCommitCommand(settings=settings)
new_path = shutil.copytree(settings.notebooks_root_path, settings.notebooks_root_path / "../remote")
new_path = new_path.resolve()
for _ in range(10):
random_age_file = settings.notebooks_root_path / f"{faker.word()}.age"
random_age_file.touch()
commit_command.run()
push_command = GitPushCommand(settings)
push_command = GitPushCommand(settings=settings)
push_command.repo.create_remote("origin", str(new_path))
return push_command
def test_push_to_origin(settings, command):
def test_push_to_origin(command):
"""Test that the command pushes to the origin remote"""
command.run()
def test_push_to_custom_remote(settings, command):
"""Test that the command pushes to a custom remote"""
remote_path = settings.notebooks_root_path / "../remote"
command.repo.create_remote("custom", str(remote_path.resolve()))
command.run(remotes=["custom"])
command.remotes = ["custom"]
command.run()