Skip to content

Commit a7c5b31

Browse files
committed
added test to DA
1 parent 78eca07 commit a7c5b31

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

da/da_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func TestAPI_AppBundle(t *testing.T) {
8484

8585
testAppName := "GolangSDKTest"
8686
testEngine := "Autodesk.3dsMax+2019"
87-
var testAlias da.Alias
87+
//var testAlias da.Alias
8888
var app da.AppBundle
8989

9090
nickname, err := daApi.UserId()
@@ -100,7 +100,7 @@ func TestAPI_AppBundle(t *testing.T) {
100100

101101
if app.ID != nickname+"."+testAppName {
102102
t.Fatalf("The id of created app mismatch: expect '%s', got '%s'",
103-
testAppName,
103+
nickname+"."+testAppName,
104104
app.ID)
105105
}
106106
})
@@ -124,7 +124,7 @@ func TestAPI_AppBundle(t *testing.T) {
124124
})
125125

126126
t.Run("Create alias for app", func(t *testing.T) {
127-
testAlias, err = app.CreateAlias("test", 1)
127+
_, err := app.CreateAlias("test", 1)
128128
if err != nil {
129129
t.Fatalf("Could not create alias: %s", err.Error())
130130
}
@@ -507,7 +507,7 @@ func TestAPI_Activity(t *testing.T) {
507507

508508
}
509509

510-
testActivity, err := daApi.CreateActivity(config)
510+
testActivity, err = daApi.CreateActivity(config)
511511
if err != nil {
512512
t.Fatal(err.Error())
513513
}

da/user.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"io/ioutil"
66
"net/http"
77
"strconv"
8+
"strings"
89
)
910

1011
func getUserID(path string, token string) (nickname string, err error) {
@@ -33,7 +34,9 @@ func getUserID(path string, token string) (nickname string, err error) {
3334
return
3435
}
3536

36-
nickname = string(data)
37+
//TODO: Review why the data has quotes in its content and find a more elegant way to remove them
38+
nickname = strings.Replace(string(data), "\"", "", -1 )
39+
3740

3841
return
3942
}

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/apprentice3d/forge-api-go-client
2+
3+
go 1.12

recap/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ type ErrorMessage struct {
119119

120120
// BUG(apprentice3d) Frequently the operation succeeded with returning code 200, meaning that the task was
121121
// received successfully, but failed to execute due to reasons specified in message
122-
// (g.e. uploading a file by specifying an wrong link: POST request is successful,
122+
// (g.e. uploading a file by specifying a wrong link: POST request is successful,
123123
// but internally it failed to download the file because of the wrongly provided link)
124124

125125
// Error is inner struct encountered in cases when the server reported status OK, but still contains details

0 commit comments

Comments
 (0)