-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_domain.py
More file actions
33 lines (27 loc) · 831 Bytes
/
test_domain.py
File metadata and controls
33 lines (27 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
import unittest
from .client import Client
class TestDomain(unittest.TestCase):
def setUp(self):
self.s = Client(os.getenv('KEY')).domain()
def test_dns(self):
response = self.s.dns({
'type': 'A',
'domain': 'twilio.com'
})
self.assertNotEqual(len(response['records']), 0)
def test_search(self):
response = self.s.search({
'q': 'twilio'
})
self.assertNotEqual(len(response['results']), 0)
def test_status(self):
response = self.s.status({
'domain': 'twilio.com'
})
self.assertEqual(response['result'], 'unavailable')
def test_whois(self):
response = self.s.whois({
'domain': 'twilio.com'
})
self.assertNotEqual(response['raw'], '')