Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhooker committed Mar 11, 2021
1 parent 1dd9469 commit b96b547
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/hashicorp/go-tfe

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.1
github.com/google/go-querystring v1.0.0
github.com/hashicorp/go-cleanhttp v0.5.0
github.com/hashicorp/go-retryablehttp v0.5.2
Expand Down
16 changes: 16 additions & 0 deletions workspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,22 @@ func TestWorkspacesRead(t *testing.T) {
})
}

func TestWorkspacesReadWithHistory(t *testing.T) {
client := testClient(t)

orgTest, orgTestCleanup := createOrganization(t, client)
defer orgTestCleanup()

wTest, wTestCleanup := createWorkspace(t, client, orgTest)
defer wTestCleanup()

run, rCleanup := createAppliedRun(t, client, wTest)
defer rCleanup()

assert.Equal(t, 1, run.Workspace.RunsCount)
assert.Equal(t, 1, run.Workspace.ResourceCount)
}

func TestWorkspacesReadByID(t *testing.T) {
client := testClient(t)
ctx := context.Background()
Expand Down

0 comments on commit b96b547

Please sign in to comment.