store: give ComposeRequest a real distro
`ComposeRequest` included a `common.Distribution`, which had to be resolved in PushComposeRequest. Use a real `distro.Distro` object here, and push resolving it to the rcm package. Change the `Distribution` on the (lower-case) `composeRequest` to a string. This struct represents the incoming request. Since we're now resolving the real distro object from the registry in the same function, it seems redundant to validate the incoming distro twice.
This commit is contained in:
parent
f68679c09f
commit
c2c8fae093
4 changed files with 20 additions and 24 deletions
|
|
@ -54,7 +54,7 @@ func TestBasicRcmAPI(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
distroStruct := fedoratest.New()
|
||||
api := rcm.New(nil, store.New(nil, distroStruct, *registry), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()))
|
||||
api := rcm.New(nil, store.New(nil, distroStruct, *registry), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()), registry)
|
||||
|
||||
for _, c := range cases {
|
||||
resp := internalRequest(api, c.Method, c.Path, c.Body, c.ContentType)
|
||||
|
|
@ -81,7 +81,7 @@ func TestSubmitCompose(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
api := rcm.New(nil, store.New(nil, distroStruct, *registry), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()))
|
||||
api := rcm.New(nil, store.New(nil, distroStruct, *registry), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()), registry)
|
||||
|
||||
var submit_reply struct {
|
||||
UUID uuid.UUID `json:"compose_id"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue