for_all_repos: adapt test

The `this` repo is skipped in the test for the `for-all-repos` command.
Adapt to checking for KAS_REPO_URL being empty instead of comparing the
KAS_REPO_NAME. This way the test will fail if the implementation
diverges from the documentation:
> KAS_REPO_URL: The URL from which this repository was cloned, or an
> empty string if no remote URL was given in the config file.

Signed-off-by: Daniel Wagenknecht <dwagenknecht@emlix.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Daniel Wagenknecht 2021-10-15 11:30:50 +02:00 committed by Jan Kiszka
parent a40127f8ed
commit 358e5924c4

View File

@ -32,7 +32,7 @@ def test_for_all_repos(changedir, tmpdir):
shutil.copytree('tests/test_commands', tdir)
os.chdir(tdir)
kas.kas(['for-all-repos', 'test.yml',
'''if [ "${KAS_REPO_NAME}" != "this" ]; then git rev-parse HEAD \
'''if [ -n "${KAS_REPO_URL}" ]; then git rev-parse HEAD \
>> %s/ref_${KAS_REPO_NAME}; fi''' % (tdir)])
with open('ref_kas_1.0', 'r') as f: