Skip to content

Commit e6d5b76

Browse files
simplify asserts
1 parent ecddf7b commit e6d5b76

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

cfn-resources/test/e2e/cluster-pause/cluster_pause_test.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ func testCreatePauseStack(t *testing.T, c *pauseTestContext) {
142142

143143
cluster := readPauseClusterFromAtlas(t, c)
144144

145-
a := assert.New(t)
146-
a.Equal(cluster.GetId(), clusterID)
147-
a.False(cluster.GetPaused())
145+
assert.Equal(t, cluster.GetId(), clusterID)
146+
assert.False(t, cluster.GetPaused())
148147
}
149148

150149
func testUpdatePauseState(t *testing.T, c *pauseTestContext, pause bool) {
@@ -165,20 +164,14 @@ func testUpdatePauseState(t *testing.T, c *pauseTestContext, pause bool) {
165164

166165
cluster := readPauseClusterFromAtlas(t, c)
167166

168-
a := assert.New(t)
169-
if pause {
170-
a.True(cluster.GetPaused())
171-
} else {
172-
a.False(cluster.GetPaused())
173-
}
167+
assert.Equal(t, pause, cluster.GetPaused())
174168
}
175169

176170
func testDeletePauseStack(t *testing.T, c *pauseTestContext) {
177171
t.Helper()
178172
utility.DeleteStack(t, c.cfnClient, pauseStackName)
179-
a := assert.New(t)
180173
_, resp, _ := c.atlasClient20231115014.ClustersApi.GetCluster(ctx.Background(), c.clusterTmplObj.ProjectID, c.clusterTmplObj.Name).Execute()
181-
a.Equal(404, resp.StatusCode)
174+
assert.Equal(t, 404, resp.StatusCode)
182175
}
183176

184177
func cleanupPauseResources(t *testing.T, c *pauseTestContext) {

0 commit comments

Comments
 (0)