Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test_action_default and fix linux #76

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions mu_repo/tests/test_action_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@
def test_action_default(workdir, monkeypatch):
workdir = Path(workdir)
monkeypatch.chdir(workdir)
subprocess.check_call(f'git init core')
subprocess.check_call(f'git init app')
# Init two repos: core, and app, with app depending on core.
subprocess.check_call(['git', 'init', 'core'])
subprocess.check_call(['git', 'init', 'app'])
(workdir/ 'app/.mu_repo').write_text("repo=.\nrepo=../core\n", encoding="utf-8")

# Add a new configuration value only to 'app'.
monkeypatch.chdir(workdir/ 'app')
subprocess.check_call(f'git config --add foo.bar foo-value')
subprocess.check_call(['git', 'config', '--add', 'foo.bar', 'foo-value'])

subprocess.check_call(f'git config --get foo.bar')
# Sanity check we can get the option.
subprocess.check_call(['git', 'config', '--get', 'foo.bar'])

# Getting a standard option will work for all repositories.
status = mu_repo.main(args=['config', '--get', 'core.bare'], config_file='.mu_repo')
assert status == mu_repo.Status("Finished", succeeded=True)

# Getting 'foobar' will only work for 'app'.
status = mu_repo.main(args=['config', '--get', 'foo.bar'], config_file='.mu_repo')
assert status == mu_repo.Status("Failed:\n ../core", succeeded=False)

Expand Down
Loading