[PATCH 3/3] test(lock): test if commits are printed on update

1 view
Skip to first unread message

Felix Moessbauer

unread,
Sep 2, 2025, 6:49:03 AM (5 days ago) Sep 2
to kas-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
We add a simple check to see if the commit log is printed on
kas lock --update.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
tests/test_commands.py | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/tests/test_commands.py b/tests/test_commands.py
index 2ace559ec..cfc0a6b99 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -315,6 +315,8 @@ def test_lockfile(monkeykas, tmpdir, capsys):

# insert older commit into lockfile (kas post commit/branch introduction)
test_commit = '226e92a7f30667326a63fd9812b8cc4a6184e398'
+ # a commit message between test_commit and HEAD
+ test_shortmsg = 'Release 4.8'
lockspec['overrides']['repos']['externalrepo']['commit'] = test_commit
with open('test.lock.yml', 'w') as f:
yaml.safe_dump(lockspec, f)
@@ -326,7 +328,9 @@ def test_lockfile(monkeykas, tmpdir, capsys):
== test_commit

# update lockfile, check if repo is pinned to other commit
+ capsys.readouterr()
kas.kas('dump --lock --inplace --update test.yml'.split())
+ assert test_shortmsg in capsys.readouterr().out
with open('test.lock.yml', 'r') as f:
lockspec = yaml.safe_load(f)
assert lockspec['overrides']['repos']['externalrepo']['commit'] \
--
2.51.0

Reply all
Reply to author
Forward
0 new messages