Skip to content

Commit a0d9fc6

Browse files
authored
Add support for trustee service in transfers (#499)
1 parent 553edcb commit a0d9fc6

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

dnsimple/struct/domain_transfer.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,26 @@
99
class DomainTransferRequest(dict):
1010
"""DomainTransferRequest represents the attributes you can pass to a register API request."""
1111

12-
def __init__(self, registrant_id, auth_code, whois_privacy=False, auto_renew=False, extended_attributes=None,
13-
premium_price=None):
14-
dict.__init__(self, registrant_id=registrant_id, auth_code=auth_code, whois_privacy=whois_privacy,
15-
auto_renew=auto_renew, extended_attributes=extended_attributes, premium_price=premium_price)
12+
def __init__(
13+
self,
14+
registrant_id,
15+
auth_code,
16+
whois_privacy=False,
17+
auto_renew=False,
18+
extended_attributes=None,
19+
premium_price=None,
20+
trustee_service=None,
21+
):
22+
dict.__init__(
23+
self,
24+
registrant_id=registrant_id,
25+
auth_code=auth_code,
26+
whois_privacy=whois_privacy,
27+
auto_renew=auto_renew,
28+
extended_attributes=extended_attributes,
29+
premium_price=premium_price,
30+
trustee_service=trustee_service,
31+
)
1632

1733
def to_json(self):
1834
return json.dumps(omitempty(self))
@@ -33,6 +49,8 @@ class DomainTransfer(Struct):
3349
"""True if the domain auto-renew was requested"""
3450
whois_privacy = False
3551
"""True if the domain WHOIS privacy was requested"""
52+
trustee_service = False
53+
"""True if the domain Trustee service was requested"""
3654
created_at = None
3755
"""When the domain transfer was created in DNSimple"""
3856
updated_at = None

tests/service/registrar_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def test_transfer_domain(self):
108108
self.assertEqual('transferring', domain_transfer.state)
109109
self.assertFalse(domain_transfer.auto_renew)
110110
self.assertFalse(domain_transfer.whois_privacy)
111+
self.assertFalse(domain_transfer.trustee_service)
111112
self.assertEqual('2016-12-09T19:43:41Z', domain_transfer.created_at)
112113
self.assertEqual('2016-12-09T19:43:43Z', domain_transfer.updated_at)
113114

@@ -140,6 +141,7 @@ def test_get_domain_transfer(self):
140141
domain_transfer = self.registrar.get_domain_transfer(1010, 'ruby.codes', 358).data
141142

142143
self.assertEqual('cancelled', domain_transfer.state)
144+
self.assertFalse(domain_transfer.trustee_service)
143145

144146
@responses.activate
145147
def test_cancel_domain_transfer(self):
@@ -149,6 +151,7 @@ def test_cancel_domain_transfer(self):
149151
domain_transfer = self.registrar.cancel_domain_transfer(1010, 'ruby.codes', 358).data
150152

151153
self.assertEqual('transferring', domain_transfer.state)
154+
self.assertFalse(domain_transfer.trustee_service)
152155

153156
@responses.activate
154157
def test_renew_domain(self):

0 commit comments

Comments
 (0)