Skip to content

Commit 03b6e70

Browse files
author
Matthew Hardwick
authored
add handling in bdd runner for unstable operations (#458)
* add handling in bdd runner for unstable operations * don't add that undo in this pr * fix docstring
1 parent ddfcf16 commit 03b6e70

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/api/v2/datadog/scenarios_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ func TestScenarios(t *testing.T) {
112112
s.AddStep(`a valid "apiKeyAuth" key in the system`, aValidAPIKeyAuth)
113113
s.AddStep(`a valid "appKeyAuth" key in the system`, aValidAppKeyAuth)
114114
s.AddStep(`an instance of "([^"]+)" API`, anInstanceOf)
115+
s.AddStep(`operation "([^"]+)" enabled`, enableOperations)
115116
s.AddStep(`there is a valid "user" in the system`, user)
116117
s.AddStep(`there is a valid "role" in the system`, role)
117118
s.AddStep(`the "user" has the "role"`, userHasRole)
@@ -160,6 +161,12 @@ func anInstanceOf(t gobdd.StepTest, ctx gobdd.Context, name string) {
160161
tests.SetAPI(ctx, f)
161162
}
162163

164+
// enableOperations sets unstable operations specific in this clause to enabled
165+
func enableOperations(t gobdd.StepTest, ctx gobdd.Context, name string) {
166+
client := Client(tests.GetCtx(ctx))
167+
client.GetConfig().SetUnstableOperationEnabled(name, true)
168+
}
169+
163170
func user(t gobdd.StepTest, ctx gobdd.Context) {
164171
client := Client(tests.GetCtx(ctx))
165172

0 commit comments

Comments
 (0)