Skip to content

Commit

Permalink
v2_test: Add a test for GetDistributionsList
Browse files Browse the repository at this point in the history
  • Loading branch information
bcl committed Aug 29, 2024
1 parent 2a21769 commit 5f16411
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/cloudapi/v2/v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5f16411

Please sign in to comment.