Skip to content

Commit

Permalink
Fixed tests to use defer
Browse files Browse the repository at this point in the history
  • Loading branch information
ezilber-akamai committed Feb 8, 2023
1 parent f426b36 commit deb3e46
Show file tree
Hide file tree
Showing 7 changed files with 258 additions and 50 deletions.
65 changes: 60 additions & 5 deletions test/integration/fixtures/TestLongviewClient_Create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ interactions:
url: https://api.linode.com/v4beta/longview/clients
method: POST
response:
body: '{"id": 297843, "label": "testing", "api_key": "4A25B21E-E082-4B68-B557F547FF76550E",
"install_code": "6F8CC589-FA36-4730-B37EFE00010D2782", "apps": {"apache": 0,
body: '{"id": 297869, "label": "testing", "api_key": "330D197F-1EFC-4D49-A6B0AA508B141B92",
"install_code": "A091884B-6F64-493F-B81F14570275BDDF", "apps": {"apache": 0,
"nginx": 0, "mysql": 0}, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}'
headers:
Access-Control-Allow-Credentials:
Expand Down Expand Up @@ -68,11 +68,11 @@ interactions:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/longview/clients/297843
url: https://api.linode.com/v4beta/longview/clients/297869
method: GET
response:
body: '{"id": 297843, "label": "testing", "api_key": "4A25B21E-E082-4B68-B557F547FF76550E",
"install_code": "6F8CC589-FA36-4730-B37EFE00010D2782", "apps": {"apache": false,
body: '{"id": 297869, "label": "testing", "api_key": "330D197F-1EFC-4D49-A6B0AA508B141B92",
"install_code": "A091884B-6F64-493F-B81F14570275BDDF", "apps": {"apache": false,
"nginx": false, "mysql": false}, "created": "2018-01-02T03:04:05", "updated":
"2018-01-02T03:04:05"}'
headers:
Expand Down Expand Up @@ -118,3 +118,58 @@ interactions:
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/longview/clients/297869
method: DELETE
response:
body: '{}'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
Access-Control-Allow-Methods:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Access-Control-Expose-Headers:
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
Cache-Control:
- private, max-age=60, s-maxage=60
Content-Length:
- "2"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Server:
- nginx
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization, X-Filter
X-Accepted-Oauth-Scopes:
- longview:read_write
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
X-Ratelimit-Limit:
- "800"
X-Xss-Protection:
- 1; mode=block
status: 200 OK
code: 200
duration: ""
19 changes: 8 additions & 11 deletions test/integration/fixtures/TestLongviewClient_Delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ interactions:
url: https://api.linode.com/v4beta/longview/clients
method: POST
response:
body: '{"id": 297844, "label": "testing", "api_key": "A9DDA1AC-D5D8-4563-B7DF18B3DB7B8597",
"install_code": "E568782A-0AB6-4FF3-A187E83F2C99A8D0", "apps": {"apache": 0,
body: '{"id": 297870, "label": "testing", "api_key": "A499EE5E-CDAF-41FB-9EF0DBEE7B7ADED5",
"install_code": "56B9DBBB-EF00-4715-9E1BB3C129613918", "apps": {"apache": 0,
"nginx": 0, "mysql": 0}, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}'
headers:
Access-Control-Allow-Credentials:
Expand Down Expand Up @@ -68,11 +68,11 @@ interactions:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/longview/clients/297844
url: https://api.linode.com/v4beta/longview/clients/297870
method: GET
response:
body: '{"id": 297844, "label": "testing", "api_key": "A9DDA1AC-D5D8-4563-B7DF18B3DB7B8597",
"install_code": "E568782A-0AB6-4FF3-A187E83F2C99A8D0", "apps": {"apache": false,
body: '{"id": 297870, "label": "testing", "api_key": "A499EE5E-CDAF-41FB-9EF0DBEE7B7ADED5",
"install_code": "56B9DBBB-EF00-4715-9E1BB3C129613918", "apps": {"apache": false,
"nginx": false, "mysql": false}, "created": "2018-01-02T03:04:05", "updated":
"2018-01-02T03:04:05"}'
headers:
Expand Down Expand Up @@ -128,7 +128,7 @@ interactions:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/longview/clients/297844
url: https://api.linode.com/v4beta/longview/clients/297870
method: DELETE
response:
body: '{}'
Expand Down Expand Up @@ -186,10 +186,7 @@ interactions:
url: https://api.linode.com/v4beta/longview/clients
method: GET
response:
body: '{"data": [{"id": 297759, "label": "testing_updated", "api_key": "D3C3F4FD-4E01-47EE-92A5055CEE3116D9",
"install_code": "7C690D25-77C9-4207-A09693CCA51A4066", "apps": {"apache": false,
"nginx": false, "mysql": false}, "created": "2018-01-02T03:04:05", "updated":
"2018-01-02T03:04:05"}], "page": 1, "pages": 1, "results": 1}'
body: '{"data": [], "page": 1, "pages": 1, "results": 0}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand All @@ -205,7 +202,7 @@ interactions:
- private, max-age=0, s-maxage=0, no-cache, no-store
- private, max-age=60, s-maxage=60
Content-Length:
- "323"
- "49"
Content-Security-Policy:
- default-src 'none'
Content-Type:
Expand Down
76 changes: 64 additions & 12 deletions test/integration/fixtures/TestLongviewClient_Get.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ interactions:
url: https://api.linode.com/v4beta/longview/clients
method: POST
response:
body: '{"id": 297841, "label": "testing", "api_key": "DCB2C833-9ABF-40D8-B986D9B5E62475AB",
"install_code": "D21C8D44-D169-43D3-A04D234C1FFCE621", "apps": {"apache": 0,
body: '{"id": 297868, "label": "testing", "api_key": "0C1CE320-E5B9-4FCE-89E45583B5D2F146",
"install_code": "B57EDD9D-2616-418B-BC3DC1B2AF836593", "apps": {"apache": 0,
"nginx": 0, "mysql": 0}, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}'
headers:
Access-Control-Allow-Credentials:
Expand Down Expand Up @@ -68,11 +68,11 @@ interactions:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/longview/clients/297841
url: https://api.linode.com/v4beta/longview/clients/297868
method: GET
response:
body: '{"id": 297841, "label": "testing", "api_key": "DCB2C833-9ABF-40D8-B986D9B5E62475AB",
"install_code": "D21C8D44-D169-43D3-A04D234C1FFCE621", "apps": {"apache": false,
body: '{"id": 297868, "label": "testing", "api_key": "0C1CE320-E5B9-4FCE-89E45583B5D2F146",
"install_code": "B57EDD9D-2616-418B-BC3DC1B2AF836593", "apps": {"apache": false,
"nginx": false, "mysql": false}, "created": "2018-01-02T03:04:05", "updated":
"2018-01-02T03:04:05"}'
headers:
Expand Down Expand Up @@ -131,13 +131,10 @@ interactions:
url: https://api.linode.com/v4beta/longview/clients
method: GET
response:
body: '{"data": [{"id": 297841, "label": "testing", "api_key": "DCB2C833-9ABF-40D8-B986D9B5E62475AB",
"install_code": "D21C8D44-D169-43D3-A04D234C1FFCE621", "apps": {"apache": false,
body: '{"data": [{"id": 297868, "label": "testing", "api_key": "0C1CE320-E5B9-4FCE-89E45583B5D2F146",
"install_code": "B57EDD9D-2616-418B-BC3DC1B2AF836593", "apps": {"apache": false,
"nginx": false, "mysql": false}, "created": "2018-01-02T03:04:05", "updated":
"2018-01-02T03:04:05"}, {"id": 297759, "label": "testing_updated", "api_key":
"D3C3F4FD-4E01-47EE-92A5055CEE3116D9", "install_code": "7C690D25-77C9-4207-A09693CCA51A4066",
"apps": {"apache": false, "nginx": false, "mysql": false}, "created": "2018-01-02T03:04:05",
"updated": "2018-01-02T03:04:05"}], "page": 1, "pages": 1, "results": 2}'
"2018-01-02T03:04:05"}], "page": 1, "pages": 1, "results": 1}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand All @@ -153,7 +150,7 @@ interactions:
- private, max-age=0, s-maxage=0, no-cache, no-store
- private, max-age=60, s-maxage=60
Content-Length:
- "591"
- "315"
Content-Security-Policy:
- default-src 'none'
Content-Type:
Expand Down Expand Up @@ -181,3 +178,58 @@ interactions:
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/longview/clients/297868
method: DELETE
response:
body: '{}'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
Access-Control-Allow-Methods:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Access-Control-Expose-Headers:
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
Cache-Control:
- private, max-age=60, s-maxage=60
Content-Length:
- "2"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Server:
- nginx
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization, X-Filter
X-Accepted-Oauth-Scopes:
- longview:read_write
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
X-Ratelimit-Limit:
- "800"
X-Xss-Protection:
- 1; mode=block
status: 200 OK
code: 200
duration: ""
7 changes: 2 additions & 5 deletions test/integration/fixtures/TestLongviewClient_List.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ interactions:
url: https://api.linode.com/v4beta/longview/clients
method: GET
response:
body: '{"data": [{"id": 297759, "label": "testing_updated", "api_key": "D3C3F4FD-4E01-47EE-92A5055CEE3116D9",
"install_code": "7C690D25-77C9-4207-A09693CCA51A4066", "apps": {"apache": false,
"nginx": false, "mysql": false}, "created": "2018-01-02T03:04:05", "updated":
"2018-01-02T03:04:05"}], "page": 1, "pages": 1, "results": 1}'
body: '{"data": [], "page": 1, "pages": 1, "results": 0}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand All @@ -33,7 +30,7 @@ interactions:
- private, max-age=0, s-maxage=0, no-cache, no-store
- private, max-age=60, s-maxage=60
Content-Length:
- "323"
- "49"
Content-Security-Policy:
- default-src 'none'
Content-Type:
Expand Down
65 changes: 60 additions & 5 deletions test/integration/fixtures/TestLongviewClient_Update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ interactions:
url: https://api.linode.com/v4beta/longview/clients
method: POST
response:
body: '{"id": 297848, "label": "testing", "api_key": "6DED101F-DAF5-4712-BD33A7C21D54B05E",
"install_code": "2AEC48C4-C227-4BEF-B3A944C3223B1947", "apps": {"apache": 0,
body: '{"id": 297871, "label": "testing", "api_key": "64F57EAB-2537-4E1F-BCC9CF54C3F81509",
"install_code": "1ADE47BD-63B1-4088-859EE040850716AA", "apps": {"apache": 0,
"nginx": 0, "mysql": 0}, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}'
headers:
Access-Control-Allow-Credentials:
Expand Down Expand Up @@ -68,11 +68,11 @@ interactions:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/longview/clients/297848
url: https://api.linode.com/v4beta/longview/clients/297871
method: PUT
response:
body: '{"id": 297848, "label": "testing_updated", "api_key": "6DED101F-DAF5-4712-BD33A7C21D54B05E",
"install_code": "2AEC48C4-C227-4BEF-B3A944C3223B1947", "apps": {"apache": false,
body: '{"id": 297871, "label": "testing_updated", "api_key": "64F57EAB-2537-4E1F-BCC9CF54C3F81509",
"install_code": "1ADE47BD-63B1-4088-859EE040850716AA", "apps": {"apache": false,
"nginx": false, "mysql": false}, "created": "2018-01-02T03:04:05", "updated":
"2018-01-02T03:04:05"}'
headers:
Expand Down Expand Up @@ -116,3 +116,58 @@ interactions:
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/longview/clients/297871
method: DELETE
response:
body: '{}'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
Access-Control-Allow-Methods:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Access-Control-Expose-Headers:
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
Cache-Control:
- private, max-age=60, s-maxage=60
Content-Length:
- "2"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Server:
- nginx
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization, X-Filter
X-Accepted-Oauth-Scopes:
- longview:read_write
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
X-Ratelimit-Limit:
- "800"
X-Xss-Protection:
- 1; mode=block
status: 200 OK
code: 200
duration: ""
Loading

0 comments on commit deb3e46

Please sign in to comment.