Skip to content

Commit

Permalink
Improve test_action_default and fix linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus authored and fabioz committed Feb 8, 2024
1 parent 0d23dee commit 6cac784
Showing 1 changed file with 9 additions and 4 deletions.
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

0 comments on commit 6cac784

Please sign in to comment.