Skip to content

Commit 0544bb4

Browse files
Enable SLO test scenarios (#371)
* added unique_lower_alnum
1 parent 1147719 commit 0544bb4

13 files changed

+454
-14
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev6",
7-
"regenerated": "2021-04-09 13:57:22.756833",
8-
"spec_repo_commit": "8873fe5"
7+
"regenerated": "2021-04-09 15:23:48.583852",
8+
"spec_repo_commit": "e13b005"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev6",
12-
"regenerated": "2021-04-09 13:57:48.076022",
13-
"spec_repo_commit": "8873fe5"
12+
"regenerated": "2021-04-09 15:24:11.624934",
13+
"spec_repo_commit": "e13b005"
1414
}
1515
}
1616
}

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ def context(vcr, unique, unique_lower, now_ts, now_iso, hour_later_ts, hour_late
207207
"unique": unique,
208208
"unique_lower": unique_lower,
209209
"unique_alnum": re.sub(r"[^A-Za-z0-9]+", "", unique),
210+
"unique_lower_alnum": re.sub(r"[^a-z0-9]+", "", unique),
210211
"now_ts": now_ts,
211212
"now_iso": now_iso,
212213
"hour_later_ts": hour_later_ts,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2021-04-09T16:17:04.950036+02:00
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
interactions:
2+
- request:
3+
body: '{}'
4+
headers:
5+
Accept:
6+
- application/json
7+
Content-Type:
8+
- application/json
9+
Dd-Operation-Id:
10+
- CreateSlo
11+
User-Agent:
12+
- datadog-api-client-python/1.0.0b8.dev35+dirty (python 3.7.9; os Darwin; arch
13+
x86_64)
14+
method: POST
15+
uri: https://api.datadoghq.com/api/v1/slo
16+
response:
17+
body:
18+
string: '{"errors": ["Invalid payload: Required parameter ''type'' is missing"]}'
19+
headers:
20+
Connection:
21+
- keep-alive
22+
Content-Length:
23+
- '69'
24+
Content-Type:
25+
- application/json
26+
Date:
27+
- Fri, 09 Apr 2021 14:17:05 GMT
28+
cache-control:
29+
- no-cache
30+
content-security-policy:
31+
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
32+
pragma:
33+
- no-cache
34+
strict-transport-security:
35+
- max-age=15724800;
36+
x-content-type-options:
37+
- nosniff
38+
x-dd-version:
39+
- '35.4276613'
40+
x-frame-options:
41+
- SAMEORIGIN
42+
x-ratelimit-limit:
43+
- '500'
44+
x-ratelimit-period:
45+
- '60'
46+
x-ratelimit-remaining:
47+
- '498'
48+
x-ratelimit-reset:
49+
- '55'
50+
status:
51+
code: 400
52+
message: Bad Request
53+
version: 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2021-04-09T16:17:03.866538+02:00
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
interactions:
2+
- request:
3+
body: '{"type": "metric", "description": "string", "groups": ["env:test", "role:mysql"],
4+
"monitor_ids": [], "name": "datadog-api-client-python-test_create_an_slo_object_returns_ok_response-1617977823.866538",
5+
"query": {"denominator": "sum:httpservice.hits{!code:3xx}.as_count()", "numerator":
6+
"sum:httpservice.hits{code:2xx}.as_count()"}, "tags": ["env:prod", "app:core"],
7+
"thresholds": [{"target": 95.0, "target_display": "95.0", "timeframe": "7d",
8+
"warning": 98, "warning_display": "98.0"}]}'
9+
headers:
10+
Accept:
11+
- application/json
12+
Content-Type:
13+
- application/json
14+
Dd-Operation-Id:
15+
- CreateSlo
16+
User-Agent:
17+
- datadog-api-client-python/1.0.0b8.dev35+dirty (python 3.7.9; os Darwin; arch
18+
x86_64)
19+
method: POST
20+
uri: https://api.datadoghq.com/api/v1/slo
21+
response:
22+
body:
23+
string: '{"data":[{"description":"string","monitor_tags":[],"creator":{"handle":"[email protected]","name":null,"email":"[email protected]"},"thresholds":[{"warning":98.0,"warning_display":"98.","target":95.0,"target_display":"95.","timeframe":"7d"}],"groups":["env:test","role:mysql"],"type_id":1,"query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"id":"324305dde65658ada6a47adcf320618b","name":"datadog-api-client-python-test_create_an_slo_object_returns_ok_response-1617977823.866538","created_at":1617977824,"tags":["app:core","env:prod"],"modified_at":1617977824,"type":"metric"}],"error":null}'
24+
headers:
25+
Connection:
26+
- keep-alive
27+
Content-Length:
28+
- '666'
29+
Content-Type:
30+
- application/json
31+
Date:
32+
- Fri, 09 Apr 2021 14:17:04 GMT
33+
cache-control:
34+
- no-cache
35+
content-security-policy:
36+
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
37+
pragma:
38+
- no-cache
39+
strict-transport-security:
40+
- max-age=15724800;
41+
vary:
42+
- Accept-Encoding
43+
x-content-type-options:
44+
- nosniff
45+
x-dd-version:
46+
- '35.4276613'
47+
x-frame-options:
48+
- SAMEORIGIN
49+
x-ratelimit-limit:
50+
- '500'
51+
x-ratelimit-period:
52+
- '60'
53+
x-ratelimit-remaining:
54+
- '499'
55+
x-ratelimit-reset:
56+
- '56'
57+
status:
58+
code: 200
59+
message: OK
60+
- request:
61+
body: null
62+
headers:
63+
Accept:
64+
- application/json
65+
Content-Type:
66+
- application/json
67+
Dd-Operation-Id:
68+
- DeleteSlo
69+
User-Agent:
70+
- datadog-api-client-python/1.0.0b8.dev35+dirty (python 3.7.9; os Darwin; arch
71+
x86_64)
72+
method: DELETE
73+
uri: https://api.datadoghq.com/api/v1/slo/324305dde65658ada6a47adcf320618b
74+
response:
75+
body:
76+
string: '{"data":["324305dde65658ada6a47adcf320618b"],"error":null}'
77+
headers:
78+
Connection:
79+
- keep-alive
80+
Content-Length:
81+
- '58'
82+
Content-Type:
83+
- application/json
84+
Date:
85+
- Fri, 09 Apr 2021 14:17:04 GMT
86+
cache-control:
87+
- no-cache
88+
content-security-policy:
89+
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
90+
pragma:
91+
- no-cache
92+
strict-transport-security:
93+
- max-age=15724800;
94+
vary:
95+
- Accept-Encoding
96+
x-content-type-options:
97+
- nosniff
98+
x-dd-version:
99+
- '35.4276613'
100+
x-frame-options:
101+
- SAMEORIGIN
102+
x-ratelimit-limit:
103+
- '3000'
104+
x-ratelimit-period:
105+
- '10'
106+
x-ratelimit-remaining:
107+
- '2998'
108+
x-ratelimit-reset:
109+
- '6'
110+
status:
111+
code: 200
112+
message: OK
113+
version: 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2021-04-09T16:17:02.955456+02:00
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/json
7+
Content-Type:
8+
- application/json
9+
Dd-Operation-Id:
10+
- DeleteSlo
11+
User-Agent:
12+
- datadog-api-client-python/1.0.0b8.dev35+dirty (python 3.7.9; os Darwin; arch
13+
x86_64)
14+
method: DELETE
15+
uri: https://api.datadoghq.com/api/v1/slo/datadogapiclientpythontestdeleteansloreturnsnotfoundresponse1617977822955456
16+
response:
17+
body:
18+
string: '{"errors": ["SLO not found: datadogapiclientpythontestdeleteansloreturnsnotfoundresponse1617977822955456
19+
not found"]}'
20+
headers:
21+
Connection:
22+
- keep-alive
23+
Content-Length:
24+
- '117'
25+
Content-Type:
26+
- application/json
27+
Date:
28+
- Fri, 09 Apr 2021 14:17:03 GMT
29+
cache-control:
30+
- no-cache
31+
content-security-policy:
32+
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
33+
pragma:
34+
- no-cache
35+
strict-transport-security:
36+
- max-age=15724800;
37+
vary:
38+
- Accept-Encoding
39+
x-content-type-options:
40+
- nosniff
41+
x-dd-version:
42+
- '35.4276613'
43+
x-frame-options:
44+
- SAMEORIGIN
45+
x-ratelimit-limit:
46+
- '3000'
47+
x-ratelimit-period:
48+
- '10'
49+
x-ratelimit-remaining:
50+
- '2999'
51+
x-ratelimit-reset:
52+
- '7'
53+
status:
54+
code: 404
55+
message: Not Found
56+
version: 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2021-04-09T16:17:06.422617+02:00

0 commit comments

Comments
 (0)