From 46ab4884d37bd080d666b58ce86aac66de4cf6e9 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 27 Aug 2024 16:01:55 -0700 Subject: [PATCH] v2_test: Add a test for GetDistributionsList --- internal/cloudapi/v2/v2_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/cloudapi/v2/v2_test.go b/internal/cloudapi/v2/v2_test.go index b8210f1c23..77a1ca99f3 100644 --- a/internal/cloudapi/v2/v2_test.go +++ b/internal/cloudapi/v2/v2_test.go @@ -192,6 +192,21 @@ func TestGetErrorList(t *testing.T) { }`, "operation_id", "total", "details") } +func TestGetDistributionList(t *testing.T) { + srv, _, _, cancel := newV2Server(t, t.TempDir(), []string{""}, false, false) + defer cancel() + + test.TestRoute(t, srv.Handler("/api/image-builder-composer/v2"), false, "GET", fmt.Sprintf( + "/api/image-builder-composer/v2/distributions/%s", test_distro.TestArchName), ``, http.StatusOK, ` + { + "test-distro-1": [{ + "baseurls": ["https://rpmrepo.osbuild.org/v2/mirror/public/f40/f40-x86_64-rawhide-20240101"], + "check_gpg": true, + "name": "test-distro" + }] + }`, "gpgkeys", "baseurl") +} + func TestCompose(t *testing.T) { srv, _, _, cancel := newV2Server(t, t.TempDir(), []string{""}, false, false) defer cancel()