Skip to content

Commit

Permalink
added test to DA
Browse files Browse the repository at this point in the history
  • Loading branch information
apprentice3d committed Jun 3, 2020
1 parent 78eca07 commit a7c5b31
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions da/da_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestAPI_AppBundle(t *testing.T) {

testAppName := "GolangSDKTest"
testEngine := "Autodesk.3dsMax+2019"
var testAlias da.Alias
//var testAlias da.Alias
var app da.AppBundle

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

if app.ID != nickname+"."+testAppName {
t.Fatalf("The id of created app mismatch: expect '%s', got '%s'",
testAppName,
nickname+"."+testAppName,
app.ID)
}
})
Expand All @@ -124,7 +124,7 @@ func TestAPI_AppBundle(t *testing.T) {
})

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

}

testActivity, err := daApi.CreateActivity(config)
testActivity, err = daApi.CreateActivity(config)
if err != nil {
t.Fatal(err.Error())
}
Expand Down
5 changes: 4 additions & 1 deletion da/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io/ioutil"
"net/http"
"strconv"
"strings"
)

func getUserID(path string, token string) (nickname string, err error) {
Expand Down Expand Up @@ -33,7 +34,9 @@ func getUserID(path string, token string) (nickname string, err error) {
return
}

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


return
}
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/apprentice3d/forge-api-go-client

go 1.12
2 changes: 1 addition & 1 deletion recap/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type ErrorMessage struct {

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

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

0 comments on commit a7c5b31

Please sign in to comment.