Skip to content

Commit fe436bd

Browse files
committed
refactoring test constants
1 parent 1eb0707 commit fe436bd

File tree

3 files changed

+27
-32
lines changed

3 files changed

+27
-32
lines changed

internal/e2e/daemon/app_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ func TestDeleteApp(t *testing.T) {
470470

471471
t.Run("DeletingExampleApp_Fail", func(t *testing.T) {
472472
var actualResponseBody models.ErrorResponse
473-
deleteResp, err := httpClient.DeleteApp(t.Context(), noExisitingExample)
473+
deleteResp, err := httpClient.DeleteApp(t.Context(), "ZXhhbXBsZXM6anVzdGJsaW5f")
474474
require.NoError(t, err)
475475
defer deleteResp.Body.Close()
476476

@@ -818,7 +818,7 @@ func TestAppPorts(t *testing.T) {
818818
respBrick, err := httpClient.UpsertAppBrickInstanceWithResponse(
819819
t.Context(),
820820
*createResp.JSON201.Id,
821-
StreamLitUi,
821+
"arduino:streamlit_ui",
822822
client.BrickCreateUpdateRequest{},
823823
func(ctx context.Context, req *http.Request) error { return nil },
824824
)

internal/e2e/daemon/const.go

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,8 @@
1515

1616
package daemon
1717

18-
import (
19-
"go.bug.st/f"
20-
21-
"github.com/arduino/arduino-app-cli/internal/e2e/client"
22-
)
23-
2418
const (
25-
ImageClassifactionBrickID = "arduino:image_classification"
26-
StreamLitUi = "arduino:streamlit_ui"
27-
expectedDetailsAppNotfound = "unable to find the app"
28-
expectedDetailsAppInvalidAppId = "invalid app id"
29-
noExistingApp = "dXNlcjp0ZXN0LWFwcAw"
30-
malformedAppId = "this-is-definitely-not-base64"
31-
noExisitingExample = "ZXhhbXBsZXM6anVzdGJsaW5f"
32-
)
33-
34-
var (
35-
expectedVariablesDetails = []client.BrickInstanceVariable{
36-
{
37-
Description: f.Ptr("path to the custom model directory"),
38-
Name: f.Ptr("CUSTOM_MODEL_PATH"),
39-
Required: f.Ptr(false),
40-
Value: f.Ptr("/home/arduino/.arduino-bricks/ei-models"),
41-
},
42-
{
43-
Description: f.Ptr("path to the model file"),
44-
Name: f.Ptr("EI_CLASSIFICATION_MODEL"),
45-
Required: f.Ptr(false),
46-
Value: f.Ptr("/models/ootb/ei/mobilenet-v2-224px.eim"),
47-
},
48-
}
19+
ImageClassifactionBrickID = "arduino:image_classification"
20+
noExistingApp = "dXNlcjp0ZXN0LWFwcAw"
21+
malformedAppId = "this-is-definitely-not-base64"
4922
)

internal/e2e/daemon/instance_bricks_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,28 @@ import (
3131
"github.com/arduino/arduino-app-cli/internal/e2e/client"
3232
)
3333

34+
const (
35+
expectedDetailsAppInvalidAppId = "invalid app id"
36+
expectedDetailsAppNotfound = "unable to find the app"
37+
)
38+
39+
var (
40+
expectedVariablesDetails = []client.BrickInstanceVariable{
41+
{
42+
Description: f.Ptr("path to the custom model directory"),
43+
Name: f.Ptr("CUSTOM_MODEL_PATH"),
44+
Required: f.Ptr(false),
45+
Value: f.Ptr("/home/arduino/.arduino-bricks/ei-models"),
46+
},
47+
{
48+
Description: f.Ptr("path to the model file"),
49+
Name: f.Ptr("EI_CLASSIFICATION_MODEL"),
50+
Required: f.Ptr(false),
51+
Value: f.Ptr("/models/ootb/ei/mobilenet-v2-224px.eim"),
52+
},
53+
}
54+
)
55+
3456
func setupTestApp(t *testing.T) (*client.CreateAppResp, *client.ClientWithResponses) {
3557
httpClient := GetHttpclient(t)
3658
createResp, err := httpClient.CreateAppWithResponse(

0 commit comments

Comments
 (0)