From 6cac784fc7f8d934d21833cf899313d65cf847a3 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 8 Feb 2024 08:58:10 -0300 Subject: [PATCH] Improve test_action_default and fix linux --- mu_repo/tests/test_action_default.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mu_repo/tests/test_action_default.py b/mu_repo/tests/test_action_default.py index f62b007..77f9f76 100644 --- a/mu_repo/tests/test_action_default.py +++ b/mu_repo/tests/test_action_default.py @@ -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)