Blame SOURCES/0001-tests-Update-tests-for-osbuild-composer-changes.patch

d059f3
From b1d63edcd830a5a23eaa838f536769681db24acb Mon Sep 17 00:00:00 2001
d059f3
From: "Brian C. Lane" <bcl@redhat.com>
d059f3
Date: Tue, 14 Jun 2022 13:43:45 -0700
d059f3
Subject: [PATCH] tests: Update tests for osbuild-composer changes
d059f3
d059f3
Cancel when the build is in the wrong state now returns a proper error,
d059f3
and ostree composes now accept the refid, parent, and the url without
d059f3
returning an error.
d059f3
---
d059f3
 weldr/compose_test.go | 12 +++++-------
d059f3
 1 file changed, 5 insertions(+), 7 deletions(-)
d059f3
d059f3
diff --git a/weldr/compose_test.go b/weldr/compose_test.go
d059f3
index f937510..fb2fa42 100644
d059f3
--- a/weldr/compose_test.go
d059f3
+++ b/weldr/compose_test.go
d059f3
@@ -97,14 +97,12 @@ func TestStartOSTreeComposeUrl(t *testing.T) {
d059f3
 	assert.Greater(t, len(id), 0)
d059f3
 }
d059f3
 
d059f3
-func TestStartOSTreeComposeUrlError(t *testing.T) {
d059f3
-	// Sending both the parent url and the parent id should return an error
d059f3
+func TestStartOSTreeUrlParentError(t *testing.T) {
d059f3
+	// Sending both the parent url and the parent id is now allowed
d059f3
 	id, r, err := testState.client.StartOSTreeComposeTest("cli-test-bp-1", "qcow2", "refid", "parent", "http://weldr.io", 0, 2)
d059f3
 	require.Nil(t, err)
d059f3
-	require.NotNil(t, r)
d059f3
-	assert.False(t, r.Status)
d059f3
-	assert.Equal(t, APIErrorMsg{"OSTreeOptionsError", "Supply at most one of Parent and URL"}, r.Errors[0])
d059f3
-	assert.Equal(t, len(id), 0)
d059f3
+	require.Nil(t, r)
d059f3
+	assert.Greater(t, len(id), 0)
d059f3
 }
d059f3
 
d059f3
 func TestStartOSTreeComposeUpload(t *testing.T) {
d059f3
@@ -196,7 +194,7 @@ func TestCancelFinishedCompose(t *testing.T) {
d059f3
 	require.NotNil(t, status)
d059f3
 	assert.False(t, status.Status)
d059f3
 	require.GreaterOrEqual(t, len(r), 1)
d059f3
-	assert.Equal(t, APIErrorMsg{"InternalServerError", "Internal server error: job does not exist"}, r[0])
d059f3
+	assert.Equal(t, APIErrorMsg{"BuildInWrongState", fmt.Sprintf("Build %s is not in WAITING or RUNNING.", id)}, r[0])
d059f3
 }
d059f3
 
d059f3
 func TestCancelComposeUnknown(t *testing.T) {
d059f3
-- 
d059f3
2.37.1
d059f3