Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Ortega <[email protected]>
  • Loading branch information
M0NsTeRRR committed Oct 5, 2024
1 parent 3b4bfaa commit 7f69be1
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 21 deletions.
3 changes: 2 additions & 1 deletion octodns_scaleway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def dnssec_disable(self, domain):
class ScalewayProvider(BaseProvider):
SUPPORTS_GEO = False
SUPPORTS_DYNAMIC = True
SUPPORTS_ROOT_NS = True
SUPPORTS_POOL_VALUE_STATUS = False
SUPPORTS = set((['A', 'AAAA', 'ALIAS', 'CAA', 'CNAME', 'DNAME',
'DS', 'LOC', 'MX', 'NAPTR', 'NS', 'PTR', 'SPF',
Expand Down Expand Up @@ -695,7 +696,7 @@ def _params_dynamic(self, record):

pools = record.dynamic.pools
rules = record.dynamic.rules
healthcheck = record._octodns.get('healthcheck', {})
healthcheck = record.octodns.get('healthcheck', {})

n = 0
for pool in pools:
Expand Down
166 changes: 166 additions & 0 deletions tests/fixtures/scaleway-domain-ok.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"domain": "unit.tests",
"organization_id": "",
"project_id": "",
"auto_renew_status": "enabled",
"dnssec": {
"status": "disabled",
"ds_records": []
},
"epp_code": [
"clientTransferProhibited"
],
"expired_at": "2025-07-24T22:16:38Z",
"updated_at": "2024-09-04T14:42:50Z",
"registrar": "SCALEWAY",
"is_external": false,
"status": "active",
"dns_zones": [
{
"domain": "unit.tests",
"subdomain": "",
"ns": [
"ns0.dom.scw.cloud.",
"ns1.dom.scw.cloud."
],
"ns_default": [
"ns0.dom.scw.cloud",
"ns1.dom.scw.cloud"
],
"ns_master": [],
"status": "active",
"message": null,
"updated_at": "2024-04-15T22:13:34Z",
"project_id": "",
"linked_products": []
}
],
"owner_contact": {
"id": "",
"legal_form": "individual",
"firstname": "Test",
"lastname": "Test",
"company_name": "",
"email": "localhost@domain",
"email_alt": "",
"phone_number": "+33.000000000",
"fax_number": "",
"address_line_1": "",
"address_line_2": "",
"zip": "",
"city": "",
"state": "",
"country": "",
"vat_identification_code": "",
"company_identification_code": "",
"lang": "",
"resale": false,
"questions": [],
"extension_fr": {
"mode": "individual",
"individual_info": {
"whois_opt_in": false
}
},
"extension_eu": null,
"extension_nl": null,
"whois_opt_in": false,
"email_status": "validated",
"status": "status_unknown"
},
"technical_contact": {
"id": "",
"legal_form": "legal_form_unknown",
"firstname": "",
"lastname": "",
"company_name": "",
"email": "",
"email_alt": "",
"phone_number": "",
"fax_number": "",
"address_line_1": "",
"address_line_2": "",
"zip": "",
"city": "",
"state": "",
"country": "",
"vat_identification_code": "",
"company_identification_code": "",
"lang": "unknown_language_code",
"resale": false,
"questions": [],
"extension_fr": {
"mode": "mode_unknown"
},
"extension_eu": null,
"extension_nl": null,
"whois_opt_in": false,
"email_status": "email_status_unknown",
"status": "status_unknown"
},
"administrative_contact": {
"id": "",
"legal_form": "legal_form_unknown",
"firstname": "",
"lastname": "",
"company_name": "",
"email": "",
"email_alt": "",
"phone_number": "",
"fax_number": "",
"address_line_1": "",
"address_line_2": "",
"zip": "",
"city": "",
"state": "",
"country": "",
"vat_identification_code": "",
"company_identification_code": "",
"lang": "unknown_language_code",
"resale": false,
"questions": [],
"extension_fr": {
"mode": "mode_unknown"
},
"extension_eu": null,
"extension_nl": null,
"whois_opt_in": false,
"email_status": "email_status_unknown",
"status": "status_unknown"
},
"tld": {
"name": "tests",
"dnssec_support": true,
"duration_in_years_min": 1,
"duration_in_years_max": 9,
"idn_support": false,
"offers": {
"renew": {
"action": "renew",
"operation_path": "/network/domain/domains/tests/renew",
"price": {
"currency_code": "EUR",
"units": 6,
"nanos": 590000000
}
},
"trade": {
"action": "trade",
"operation_path": "/network/domain/domains/tests/trade",
"price": {
"currency_code": "EUR",
"units": 20,
"nanos": 0
}
}
},
"specifications": {
"afnic": "1",
"grace_period": "1",
"owner_infos_fr": "1",
"transfer_without_contact": "1"
}
},
"linked_products": [],
"pending_trade": false
}
4 changes: 2 additions & 2 deletions tests/fixtures/scaleway-ok.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"data": "3-scaleway.com."
}
],
"default": ""
"default": "1-scaleway.com."
}
},
{
Expand Down Expand Up @@ -254,7 +254,7 @@
],
"must_contain": null,
"url": "HTTPS://scaleway.com:443/check",
"user_agent": "scaleway-octodns/0.0.4",
"user_agent": "scaleway-octodns/0.1.0",
"strategy": "all"
}
}
Expand Down
Loading

0 comments on commit 7f69be1

Please sign in to comment.