Skip to content

Commit 3482ea4

Browse files
committed
Fix code style tests
1 parent e172703 commit 3482ea4

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

cloudflareddns/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.3"
1+
__version__ = "0.0.4"

cloudflareddns/cloudflareddns.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ def update(cfUsername, cfKey, hostname, ip, ttl=None):
108108
log.error('/zones.dns_records.post %s - %d %s - api call failed' % (hostname, e, e))
109109
return '911'
110110

111-
112-
113111
# reached far enough without genuine return/exception catching, must be an error
114112
# using 'badagent' just because it is unique to other statuses used above
115113
return 'badagent'
116114

115+
117116
def updateRecord(hostname, ip, ttl=None):
118117
res = update(os.environ['CF_EMAIL'], os.environ['CF_KEY'], hostname, ip, ttl)
119118
return res in ['good', 'nochg']
120119

120+
121121
def main():
122122
parser = argparse.ArgumentParser(description='Update DDNS in Cloudflare.')
123123
parser.add_argument('--email', help='Cloudflare account emai')

tests/test_cloudflareddns.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_update():
3535

3636
assert newIp == ip
3737

38+
3839
def test_update_success_status():
3940

4041
cfUsername = os.environ['CF_EMAIL']
@@ -55,6 +56,7 @@ def test_update_success_status():
5556
# fetch record
5657
assert res in ['good', 'nochg']
5758

59+
5860
def test_update_record_func_success():
5961

6062
hostname = 'python{}.cloudflareddns.test.{}'.format(
@@ -68,6 +70,7 @@ def test_update_record_func_success():
6870

6971
assert res is True
7072

73+
7174
def test_update_record_func_failure():
7275

7376
# something we surely don't own and can't update:
@@ -80,4 +83,4 @@ def test_update_record_func_failure():
8083

8184
res = cloudflareddns.updateRecord(hostname, ip)
8285

83-
assert res is False
86+
assert res is False

0 commit comments

Comments
 (0)