Skip to content

tests: containerinfra unit tests are broken #3898

Description

@kayrus
$ make unit
... ... ..
=== Failed
=== FAIL: openstack/containerinfra/v1/certificates/testing TestCreateCertificates (0.00s)
    http_responses.go:93: Request method = POST, expected GET

DONE 1750 tests, 1 failure in 25.061s
exit status 1
make: *** [Makefile:40: unit] Error 1

proposed fix:

diff --git a/openstack/containerinfra/v1/certificates/testing/fixtures_test.go b/openstack/containerinfra/v1/certificates/testing/fixtures_test.go
index 67381f578..562a9f142 100644
--- a/openstack/containerinfra/v1/certificates/testing/fixtures_test.go
+++ b/openstack/containerinfra/v1/certificates/testing/fixtures_test.go
@@ -85,7 +85,7 @@ func HandleGetCertificateSuccessfully(t *testing.T, fakeServer th.FakeServer) {
 
 func HandleCreateCertificateSuccessfully(t *testing.T, fakeServer th.FakeServer) {
        fakeServer.Mux.HandleFunc("/v1/certificates/", func(w http.ResponseWriter, r *http.Request) {
-               th.TestMethod(t, r, "GET")
+               th.TestMethod(t, r, "POST")
                th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
 
                w.Header().Add("Content-Type", "application/json")

The only thing I don't understand is why the CI tests didn't catch this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions