File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1515
1616package daemon
1717
18+ import (
19+ "go.bug.st/f"
20+
21+ "github.com/arduino/arduino-app-cli/internal/e2e/client"
22+ )
23+
1824const (
1925 ImageClassifactionBrickID = "arduino:image_classification"
2026 StreamLitUi = "arduino:streamlit_ui"
@@ -24,3 +30,20 @@ const (
2430 malformedAppId = "this-is-definitely-not-base64"
2531 noExisitingExample = "ZXhhbXBsZXM6anVzdGJsaW5f"
2632)
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 ("" ),
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 ("" ),
47+ },
48+ }
49+ )
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ func TestGetAppBrickInstances(t *testing.T) {
6868 require .NoError (t , err )
6969 require .Len (t , * brickInstances .JSON200 .Bricks , 1 )
7070 require .Equal (t , ImageClassifactionBrickID , * (* brickInstances .JSON200 .Bricks )[0 ].Id )
71+ require .Equal (t , expectedVariablesDetails , * (* brickInstances .JSON200 .Bricks )[0 ].VariablesDetails )
7172
7273 })
7374
@@ -111,6 +112,7 @@ func TestGetAppBrickInstanceById(t *testing.T) {
111112 require .NoError (t , err )
112113 require .NotEmpty (t , brickInstance .JSON200 )
113114 require .Equal (t , ImageClassifactionBrickID , * brickInstance .JSON200 .Id )
115+ require .Equal (t , expectedVariablesDetails , (* brickInstance .JSON200 .VariablesDetails ))
114116 })
115117
116118 t .Run ("GetAppBrickInstanceByBrickID_InvalidAppID_Fails" , func (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -3,8 +3,9 @@ package bricks
33import (
44 "testing"
55
6- "github.com/arduino/arduino-app-cli/internal/orchestrator/bricksindex"
76 "github.com/stretchr/testify/require"
7+
8+ "github.com/arduino/arduino-app-cli/internal/orchestrator/bricksindex"
89)
910
1011func TestGetBrickInstanceVariableDetails (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments