Merged in kidmose/pywhois/feature/test-missing-keys (pull request #33)
authorRichard <richardbp@gmail.com>
Thu, 15 Feb 2018 15:32:45 +0000
changeset 167 7bec7a730d69
parent 165 92d15e20f7bd (current diff)
parent 166 6cbe4891d62a (diff)
child 168 d994f11c7e9e
child 179 2fb992c480e4
Merged in kidmose/pywhois/feature/test-missing-keys (pull request #33) test_parser.py: Fail on missing keys
--- a/test/test_parser.py	Mon Feb 12 16:50:13 2018 -0500
+++ b/test/test_parser.py	Thu Feb 15 15:32:45 2018 +0000
@@ -85,8 +85,13 @@
                 expected_results = json.load(infil)
 
             # Compare each key
-            for key in results:
+            for key in set(results).union(set(expected_results)):
                 total += 1
+                if key not in results:
+                    print("%s \t(%s):\t Missing in results" % (domain, key,))
+                    fail += 1
+                    continue
+                
                 result = results.get(key)
                 if isinstance(result, list):
                     result = [str(element) for element in result]