Skip to content

Commit

Permalink
test: Cover all cases for Configurations
Browse files Browse the repository at this point in the history
This patch covers the missing endpoints for Configurations resource.
  • Loading branch information
mauricioabreu committed Jun 7, 2018
1 parent 0c516f8 commit 4b9dcbe
Show file tree
Hide file tree
Showing 6 changed files with 548 additions and 0 deletions.
94 changes: 94 additions & 0 deletions tests/integration/cassettes/Configuration_delete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"http_interactions": [
{
"recorded_at": "2018-06-07T02:30:14",
"request": {
"body": {
"encoding": "utf-8",
"string": ""
},
"headers": {
"Accept": [
"application/json; version=1"
],
"Accept-Charset": [
"utf-8"
],
"Accept-Encoding": [
"gzip, deflate"
],
"Authorization": [
"token <AUTH_TOKEN>"
],
"Connection": [
"keep-alive"
],
"Content-Length": [
"0"
],
"Content-Type": [
"application/json"
],
"User-Agent": [
"python-requests/2.18.4"
]
},
"method": "DELETE",
"uri": "https://api.azion.net/content_delivery/configurations/1528252734"
},
"response": {
"body": {
"encoding": null,
"string": ""
},
"headers": {
"Allow": [
"GET, PUT, PATCH, DELETE, OPTIONS"
],
"Connection": [
"keep-alive"
],
"Content-Language": [
"en"
],
"Content-Length": [
"0"
],
"Date": [
"Thu, 07 Jun 2018 02:30:14 GMT"
],
"Server": [
"azion webserver"
],
"Vary": [
"Accept-Language, Cookie"
],
"X-Frame-Options": [
"SAMEORIGIN"
],
"X-RateLimit-Limit": [
"20"
],
"X-RateLimit-Remaining": [
"19"
],
"X-RateLimit-Reset": [
"2018-06-07T02:31:13.422905"
],
"x-content-type-options": [
"nosniff"
],
"x-xss-protection": [
"1; mode=block"
]
},
"status": {
"code": 204,
"message": "NO CONTENT"
},
"url": "https://api.azion.net/content_delivery/configurations/1528252734"
}
}
],
"recorded_with": "betamax/0.8.1"
}
103 changes: 103 additions & 0 deletions tests/integration/cassettes/Configuration_get.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"http_interactions": [
{
"recorded_at": "2018-06-07T01:21:42",
"request": {
"body": {
"encoding": "utf-8",
"string": ""
},
"headers": {
"Accept": [
"application/json; version=1"
],
"Accept-Charset": [
"utf-8"
],
"Accept-Encoding": [
"gzip, deflate"
],
"Authorization": [
"token <AUTH_TOKEN>"
],
"Connection": [
"keep-alive"
],
"Content-Type": [
"application/json"
],
"User-Agent": [
"python-requests/2.18.4"
]
},
"method": "GET",
"uri": "https://api.azion.net/content_delivery/configurations/1528252734"
},
"response": {
"body": {
"encoding": null,
"string": "{\"id\":1528252734,\"name\":\"Dummy configuration\",\"domain_name\":\"109445k.ha.azioncdn.net\",\"active\":true,\"delivery_protocol\":\"http\",\"digital_certificate\":null,\"cname_access_only\":false,\"rawlogs\":false,\"cname\":[\"www.example-cname.com\"]}"
},
"headers": {
"Allow": [
"GET, PUT, PATCH, DELETE, OPTIONS"
],
"Cache-Control": [
"no-cache, no-store, must-revalidate, max-age=0"
],
"Connection": [
"keep-alive"
],
"Content-Language": [
"en"
],
"Content-Length": [
"230"
],
"Content-Type": [
"application/json"
],
"Date": [
"Thu, 07 Jun 2018 01:21:42 GMT"
],
"Expires": [
"Thu, 07 Jun 2018 01:21:42 GMT"
],
"Last-Modified": [
"Thu, 07 Jun 2018 01:21:42 GMT"
],
"Server": [
"azion webserver"
],
"Vary": [
"Accept-Language, Cookie"
],
"X-Frame-Options": [
"SAMEORIGIN"
],
"X-RateLimit-Limit": [
"80"
],
"X-RateLimit-Remaining": [
"79"
],
"X-RateLimit-Reset": [
"2018-06-07T01:22:42.811207"
],
"x-content-type-options": [
"nosniff"
],
"x-xss-protection": [
"1; mode=block"
]
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://api.azion.net/content_delivery/configurations/1528252734"
}
}
],
"recorded_with": "betamax/0.8.1"
}
103 changes: 103 additions & 0 deletions tests/integration/cassettes/Configuration_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"http_interactions": [
{
"recorded_at": "2018-06-07T02:26:15",
"request": {
"body": {
"encoding": "utf-8",
"string": ""
},
"headers": {
"Accept": [
"application/json; version=1"
],
"Accept-Charset": [
"utf-8"
],
"Accept-Encoding": [
"gzip, deflate"
],
"Authorization": [
"token <AUTH_TOKEN>"
],
"Connection": [
"keep-alive"
],
"Content-Type": [
"application/json"
],
"User-Agent": [
"python-requests/2.18.4"
]
},
"method": "GET",
"uri": "https://api.azion.net/content_delivery/configurations"
},
"response": {
"body": {
"encoding": null,
"string": "[{\"id\":1501191440,\"name\":\"Lala changed via API\",\"domain_name\":\"29445k.ha.azioncdn.net\",\"active\":true,\"delivery_protocol\":\"http,https\",\"digital_certificate\":null,\"cname_access_only\":false,\"rawlogs\":false,\"cname\":[]},{\"id\":1522942414,\"name\":\"Waf Test \",\"domain_name\":\"49445k.ha.azioncdn.net\",\"active\":true,\"delivery_protocol\":\"http\",\"digital_certificate\":null,\"cname_access_only\":false,\"rawlogs\":false,\"cname\":[]},{\"id\":1522952417,\"name\":\"Meu Site\",\"domain_name\":\"59445k.ha.azioncdn.net\",\"active\":true,\"delivery_protocol\":\"http,https\",\"digital_certificate\":null,\"cname_access_only\":false,\"rawlogs\":false,\"cname\":[]},{\"id\":1525352543,\"name\":\"Testing\",\"domain_name\":\"79445k.ha.azioncdn.net\",\"active\":true,\"delivery_protocol\":\"http\",\"digital_certificate\":null,\"cname_access_only\":false,\"rawlogs\":false,\"cname\":[]},{\"id\":1528252734,\"name\":\"Dummy configuration\",\"domain_name\":\"109445k.ha.azioncdn.net\",\"active\":true,\"delivery_protocol\":\"http,https\",\"digital_certificate\":null,\"cname_access_only\":false,\"rawlogs\":false,\"cname\":[]}]"
},
"headers": {
"Allow": [
"GET, POST, OPTIONS"
],
"Cache-Control": [
"no-cache, no-store, must-revalidate, max-age=0"
],
"Connection": [
"keep-alive"
],
"Content-Language": [
"en"
],
"Content-Length": [
"1023"
],
"Content-Type": [
"application/json"
],
"Date": [
"Thu, 07 Jun 2018 02:26:15 GMT"
],
"Expires": [
"Thu, 07 Jun 2018 02:26:15 GMT"
],
"Last-Modified": [
"Thu, 07 Jun 2018 02:26:15 GMT"
],
"Server": [
"azion webserver"
],
"Vary": [
"Accept-Language, Cookie"
],
"X-Frame-Options": [
"SAMEORIGIN"
],
"X-RateLimit-Limit": [
"80"
],
"X-RateLimit-Remaining": [
"79"
],
"X-RateLimit-Reset": [
"2018-06-07T02:27:15.186579"
],
"x-content-type-options": [
"nosniff"
],
"x-xss-protection": [
"1; mode=block"
]
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://api.azion.net/content_delivery/configurations"
}
}
],
"recorded_with": "betamax/0.8.1"
}

0 comments on commit 4b9dcbe

Please sign in to comment.