Skip to content

Commit 0255989

Browse files
committed
Code cleanup
1 parent 7273396 commit 0255989

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_cloudflareddns.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44
import socket
55
from cloudflareddns import cloudflareddns
6+
import platform
67

78
# change dir to tests directory to make relative paths possible
89
os.chdir(os.path.dirname(os.path.realpath(__file__)))
@@ -12,7 +13,11 @@ def test_update():
1213

1314
cf_username = os.environ['CF_EMAIL']
1415
cf_key = os.environ['CF_KEY']
15-
hostname = os.environ['TEST_HOSTNAME']
16+
# hostname should be Python version specific so that different versions tests
17+
# don't jump onto each other, so test271.example.com, test368.example.com, etc.
18+
hostname = 'python{}.cloudflareddns.test.{}'.format(
19+
platform.python_version(),
20+
os.environ['CLOUDFLAREDDNS_TEST_DOMAIN'])
1621

1722
faker = Faker()
1823
ip = faker.ipv4()
@@ -22,7 +27,7 @@ def test_update():
2227
# cf_username, cf_key, hostname, ip, proxied=False
2328
cloudflareddns.update(cf_username, cf_key, hostname, ip, False)
2429

25-
time.sleep(600)
30+
time.sleep(180)
2631

2732
# fetch record
2833
new_ip = socket.gethostbyname(hostname)

0 commit comments

Comments
 (0)