-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathtest_domain.py
More file actions
59 lines (38 loc) · 1.65 KB
/
test_domain.py
File metadata and controls
59 lines (38 loc) · 1.65 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import re
import time
from test.integration.helpers import wait_for_condition
import pytest
from linode_api4.objects import Domain, DomainRecord
@pytest.mark.smoke
def test_get_domain_record(test_linode_client, test_domain):
dr = DomainRecord(
test_linode_client, test_domain.records.first().id, test_domain.id
)
assert dr.id == test_domain.records.first().id
def test_save_null_values_excluded(test_linode_client, test_domain):
domain = test_linode_client.load(Domain, test_domain.id)
domain.type = "master"
domain.master_ips = ["127.0.0.1"]
res = domain.save()
def test_zone_file_view(test_linode_client, test_domain):
domain = test_linode_client.load(Domain, test_domain.id)
def get_zone_file_view():
res = domain.zone_file_view()
return res != []
wait_for_condition(10, 100, get_zone_file_view)
assert domain.domain in str(domain.zone_file_view())
assert re.search("ns[0-9].linode.com", str(domain.zone_file_view()))
def test_clone(test_linode_client, test_domain):
domain = test_linode_client.load(Domain, test_domain.id)
timestamp = str(time.time_ns())
dom = "example.clone-" + timestamp + "-inttestsdk.org"
domain.clone(dom)
ds = test_linode_client.domains()
time.sleep(1)
domains = [i.domain for i in ds]
assert dom in domains
def test_import(test_linode_client, test_domain):
pytest.skip(
'Currently failing with message: linode_api4.errors.ApiError: 400: An unknown error occured. Please open a ticket for further assistance. Command: domain_import(domain, "google.ca")'
)
domain = test_linode_client.load(Domain, test_domain.id)