Skip to content

Commit

Permalink
Resell V2 projects - add more tests (#60)
Browse files Browse the repository at this point in the history
* Resell V2 projects - add more tests

Add tests for the error cases.

* Resell V2 projects - add test for empty quotas

Add create test with empty quotas.

* Resell V2 Quotas - add test for invalid update

Add test with error from marshalJSON.
  • Loading branch information
ozerovandrei committed Apr 19, 2018
1 parent 8988758 commit cc52532
Show file tree
Hide file tree
Showing 5 changed files with 407 additions and 2 deletions.
34 changes: 34 additions & 0 deletions selvpcclient/resell/v2/projects/testing/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,37 @@ var TestUpdateProjectResponse = &projects.Project{
},
CustomURL: "",
}

// TestManyProjectsInvalidResponseRaw represents a raw invalid response with many projects.
const TestManyProjectsInvalidResponseRaw = `
{
"projects": [
{
"id": 12
}
]
}
`

// TestSingleProjectInvalidResponseRaw represents a raw invalid response with a single project.
const TestSingleProjectInvalidResponseRaw = `
{
"project": {
"id": 12
}
}
`

// TestCreateProjectNoQuotasOptsRaw represents a raw request body without quotas.
const TestCreateProjectNoQuotasOptsRaw = `
{
"project": {
"name": "Project2"
}
}
`

// TestCreateProjectNoQuotasOpts represents project create options without quotas.
var TestCreateProjectNoQuotasOpts = projects.CreateOpts{
Name: "Project2",
}
Loading

0 comments on commit cc52532

Please sign in to comment.