[Git][NTPsec/ntpsec][master] 2 commits: Fix dummy URLs to comply with .invalid rule
Ian Bruene
gitlab at mg.gitlab.com
Fri Dec 8 15:44:36 UTC 2017
Ian Bruene pushed to branch master at NTPsec / ntpsec
Commits:
9bacd997 by Ian Bruene at 2017-12-08T09:44:11-06:00
Fix dummy URLs to comply with .invalid rule
- - - - -
394daf3d by Ian Bruene at 2017-12-08T09:44:11-06:00
Fixed incorrect test that used hardcoded value instead of define
- - - - -
1 changed file:
- tests/pylib/test_util.py
Changes:
=====================================
tests/pylib/test_util.py
=====================================
--- a/tests/pylib/test_util.py
+++ b/tests/pylib/test_util.py
@@ -8,6 +8,7 @@ import ntp.util
import ntp.packet
import shutil
import sys
+import socket
import jigs
@@ -512,33 +513,34 @@ class TestPylibUtilMethods(unittest.TestCase):
# Test addrinfo fail
fakesockmod.__init__()
fakesockmod.gai_error_count = 1
- self.assertEqual(f("none"), "DNSFAIL:none")
+ self.assertEqual(f("nothing"), "DNSFAIL:nothing")
self.assertEqual(fakesockmod.gai_calls,
- [("none", None, 0, 0, 0, 2)])
+ [("nothing", None, 0, 0, 0,
+ socket.AI_CANONNAME)])
self.assertEqual(fakesockmod.gni_calls, [])
# Test nameinfo fail
fakesockmod.__init__()
fakesockmod.gni_error_count = 1
- fakesockmod.gni_returns = [("www.Hastur.madness", 42)]
+ fakesockmod.gni_returns = [("www.Hastur.invalid", 42)]
fakesockmod.gai_returns = [(("family", "socktype", "proto",
- "san.Hastur.madness",
+ "san.Hastur.invalid",
"42.23.%$.(#"),)]
- self.assertEqual(f("bar:42"), "san.hastur.madness:42")
+ self.assertEqual(f("bar:42"), "san.hastur.invalid:42")
# Test nameinfo fail, no canonname
fakesockmod.__init__()
mycache.__init__()
fakesockmod.gni_error_count = 1
- fakesockmod.gni_returns = [("www.Hastur.madness", 42)]
+ fakesockmod.gni_returns = [("www.Hastur.invalid", 42)]
fakesockmod.gai_returns = [(("family", "socktype", "proto",
None, "42.23.%$.(#"),)]
self.assertEqual(f("bar:42"), "bar:42")
# Test success
fakesockmod.__init__()
mycache.__init__()
- fakesockmod.gni_returns = [("www.Hastur.madness", 42)]
+ fakesockmod.gni_returns = [("www.Hastur.invalid", 42)]
fakesockmod.gai_returns = [(("family", "socktype", "proto",
None, "42.23.%$.(#"),)]
- self.assertEqual(f("bar:42"), "www.hastur.madness:42")
+ self.assertEqual(f("bar:42"), "www.hastur.invalid:42")
finally:
ntp.util.canonicalization_cache = cachetemp
ntp.util.socket = sockettemp
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/56542599565322ec9fac07d64570c5b1601cb35e...394daf3dce1b64ad025befe246113273ab0b9bb3
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/56542599565322ec9fac07d64570c5b1601cb35e...394daf3dce1b64ad025befe246113273ab0b9bb3
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20171208/a5a1f857/attachment.html>
More information about the vc
mailing list