testutil: rename Calls() -> CallArgsList() for clarity

The current MockCmd.Calls() is a bit ambiguous so follow the example
of pytest here and rename to the cleaner CallArgsList() that
captures more closely what the helper is actually doing.
This commit is contained in:
Michael Vogt 2025-07-16 11:16:19 +02:00
parent bb45b89d84
commit ad20533d87
3 changed files with 8 additions and 8 deletions

View file

@ -392,8 +392,8 @@ centos-9-qcow2-x86_64/centos-9-qcow2-x86_64.qcow2
`)
// ensure osbuild was run exactly one
require.Equal(t, 1, len(fakeOsbuildCmd.Calls()))
osbuildCall := fakeOsbuildCmd.Calls()[0]
require.Equal(t, 1, len(fakeOsbuildCmd.CallArgsList()))
osbuildCall := fakeOsbuildCmd.CallArgsList()[0]
// --cache is passed correctly to osbuild
storePos := slices.Index(osbuildCall, "--store")
assert.True(t, storePos > -1)
@ -470,7 +470,7 @@ func TestBuildIntegrationArgs(t *testing.T) {
require.NoError(t, err)
// ensure output dir override works
osbuildCall := fakeOsbuildCmd.Calls()[0]
osbuildCall := fakeOsbuildCmd.CallArgsList()[0]
outputDirPos := slices.Index(osbuildCall, "--output-directory")
assert.True(t, outputDirPos > -1)
assert.Equal(t, outputDir, osbuildCall[outputDirPos+1])