distro: rename awkwardly named function

WithSingleDistro() doesn't follow go's naming convention for creating
objects (New*). Rename it to NewRegistry() and rename the old
NewRegistry() to NewDefaultRegistry().

The idea is that NewRegistry() can be used to create full Registry
objects from outside the package. NewDefaultRegistry() is a convenience
function that creates a Registry with all known distros.
This commit is contained in:
Lars Karlitski 2020-03-02 22:50:49 +01:00
parent 60301df8f7
commit e5eb673be6
14 changed files with 29 additions and 26 deletions

View file

@ -49,7 +49,7 @@ func TestBasicRcmAPI(t *testing.T) {
{"GET", "/v1/compose/7802c476-9cd1-41b7-ba81-43c1906bce73", `{"status":"RUNNING"}`, "application/json", http.StatusBadRequest, `{"error_reason":"Compose UUID does not exist"}`},
}
registry := distro_mock.NewRegistry()
registry := distro_mock.NewDefaultRegistry()
distroStruct := fedoratest.New()
api := rcm.New(nil, store.New(nil, distroStruct, *registry), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()))
@ -74,7 +74,7 @@ func TestBasicRcmAPI(t *testing.T) {
func TestSubmitCompose(t *testing.T) {
// Test the most basic use case: Submit a new job and get its status.
distroStruct := fedoratest.New()
registry := distro_mock.NewRegistry()
registry := distro_mock.NewDefaultRegistry()
api := rcm.New(nil, store.New(nil, distroStruct, *registry), rpmmd_mock.NewRPMMDMock(rpmmd_mock.BaseFixture()))
var submit_reply struct {