Skip to content

Commit

Permalink
Update source tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-cross committed Mar 28, 2023
1 parent b40bd7a commit f30158d
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions cmd/meroxa/root/apps/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,15 +726,15 @@ func TestGetPlatformImage(t *testing.T) {
err error
}{
{
name: "Successfully build image",
name: "Successfully build image with no env",
meroxaClient: func(ctrl *gomock.Controller) meroxa.Client {
client := mock.NewMockClient(ctrl)
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
}))

input := meroxa.CreateSourceInputV2{}
client.EXPECT().
CreateSource(ctx).
CreateSourceV2(ctx, &input).
Return(&meroxa.Source{GetUrl: sourceGetURL, PutUrl: server.URL}, nil)

client.EXPECT().
Expand Down Expand Up @@ -813,9 +813,9 @@ func TestGetPlatformImage(t *testing.T) {
name: "Fail to create source",
meroxaClient: func(ctrl *gomock.Controller) meroxa.Client {
client := mock.NewMockClient(ctrl)

input := meroxa.CreateSourceInputV2{}
client.EXPECT().
CreateSource(ctx).
CreateSourceV2(ctx, &input).
Return(&meroxa.Source{GetUrl: sourceGetURL, PutUrl: sourcePutURL}, err)
return client
},
Expand All @@ -829,9 +829,9 @@ func TestGetPlatformImage(t *testing.T) {
name: "Fail to upload source",
meroxaClient: func(ctrl *gomock.Controller) meroxa.Client {
client := mock.NewMockClient(ctrl)

input := meroxa.CreateSourceInputV2{}
client.EXPECT().
CreateSource(ctx).
CreateSourceV2(ctx, &input).
Return(&meroxa.Source{GetUrl: sourceGetURL, PutUrl: sourcePutURL}, nil)
return client
},
Expand All @@ -848,13 +848,12 @@ func TestGetPlatformImage(t *testing.T) {
name: "Fail to create build",
meroxaClient: func(ctrl *gomock.Controller) meroxa.Client {
client := mock.NewMockClient(ctrl)

server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
}))

input := meroxa.CreateSourceInputV2{}
client.EXPECT().
CreateSource(ctx).
CreateSourceV2(ctx, &input).
Return(&meroxa.Source{GetUrl: sourceGetURL, PutUrl: server.URL}, nil)

client.EXPECT().
Expand Down Expand Up @@ -882,9 +881,9 @@ func TestGetPlatformImage(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
}))

input := meroxa.CreateSourceInputV2{}
client.EXPECT().
CreateSource(ctx).
CreateSourceV2(ctx, &input).
Return(&meroxa.Source{GetUrl: sourceGetURL, PutUrl: server.URL}, nil)

client.EXPECT().
Expand Down

0 comments on commit f30158d

Please sign in to comment.