-
-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement vultr API v2 * Update test recordings for vultr API v2
- Loading branch information
1 parent
c445f37
commit ed75f0a
Showing
28 changed files
with
5,021 additions
and
1,187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,17 @@ | ||
"""Integration tests for Vultr""" | ||
from unittest import TestCase | ||
|
||
import pytest | ||
|
||
from lexicon.tests.providers.integration_tests import IntegrationTestsV1 | ||
from lexicon.tests.providers.integration_tests import IntegrationTestsV2 | ||
|
||
|
||
# Hook into testing framework by inheriting unittest.TestCase and reuse | ||
# the tests which *each and every* implementation of the interface must | ||
# pass, by inheritance from define_tests.TheTests | ||
# TODO: migrate to IntegrationTestsV2 and its extended test suite | ||
class VultrProviderTests(TestCase, IntegrationTestsV1): | ||
class VultrProviderTests(TestCase, IntegrationTestsV2): | ||
"""TestCase for Vultr""" | ||
|
||
provider_name = "vultr" | ||
domain = "capsulecd.com" | ||
domain = "lexicon-test.eu" | ||
|
||
def _filter_headers(self): | ||
return ["API-Key"] | ||
|
||
# TODO: enable the skipped tests | ||
@pytest.mark.skip(reason="new test, missing recording") | ||
def test_provider_when_calling_update_record_should_modify_record_name_specified( | ||
self, | ||
): | ||
return | ||
return ["Authorization"] |
61 changes: 39 additions & 22 deletions
61
tests/fixtures/cassettes/vultr/IntegrationTests/test_provider_authenticate.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,46 @@ | ||
interactions: | ||
- request: | ||
body: '{}' | ||
body: null | ||
headers: | ||
Accept: [application/json] | ||
Accept-Encoding: ['gzip, deflate'] | ||
Connection: [keep-alive] | ||
Content-Length: ['2'] | ||
Content-Type: [application/json] | ||
User-Agent: [python-requests/2.9.1] | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
User-Agent: | ||
- python-requests/2.25.1 | ||
method: GET | ||
uri: https://api.vultr.com/v1/dns/list | ||
uri: https://api.vultr.com/v2/domains | ||
response: | ||
body: {string: !!python/unicode '[{"domain":"capsulecd.com","date_created":"2016-04-13 | ||
19:03:44"}]'} | ||
body: | ||
string: '{"domains":[{"domain":"lexicon-test.eu","date_created":"2021-03-27T09:40:29+00:00"},{"domain":"sielski.be","date_created":"2020-09-13T18:19:59+00:00"}],"meta":{"total":2,"links":{"next":"","prev":""}}}' | ||
headers: | ||
cache-control: [no-cache] | ||
connection: [keep-alive] | ||
content-length: ['65'] | ||
content-type: [application/json] | ||
date: ['Wed, 13 Apr 2016 23:22:33 GMT'] | ||
expires: ['Wed, 13 Apr 2016 23:22:32 GMT'] | ||
server: [nginx] | ||
strict-transport-security: [max-age=31536000] | ||
transfer-encoding: [chunked] | ||
x-content-type-options: [nosniff] | ||
x-frame-options: [DENY] | ||
status: {code: 200, message: OK} | ||
Cache-Control: | ||
- no-cache | ||
Connection: | ||
- keep-alive | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Sat, 27 Mar 2021 09:41:21 GMT | ||
Expires: | ||
- Sat, 27 Mar 2021 09:41:20 GMT | ||
Server: | ||
- nginx | ||
Strict-Transport-Security: | ||
- max-age=31536000 | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- DENY | ||
X-Robots-Tag: | ||
- noindex,noarchive | ||
content-length: | ||
- '201' | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
Oops, something went wrong.