Skip to content

Commit

Permalink
Fix IP address generator
Browse files Browse the repository at this point in the history
  • Loading branch information
cyli committed Nov 17, 2014
1 parent b6444c4 commit 2132def
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mimic/test/test_util.py
Expand Up @@ -14,7 +14,7 @@ class HelperTests(SynchronousTestCase):
def _validate_ipv4_address(self, address, *prefixes):
nums = [int(x) for x in address.split('.')]
self.assertEqual(4, len(nums))
self.assertTrue(all(x > 0 and x < 255 for x in nums))
self.assertTrue(all(x >= 0 and x < 255 for x in nums))
self.assertEqual(prefixes[:len(nums)], tuple(nums[:len(prefixes)]))

def test_random_ipv4_completely_random(self):
Expand Down
2 changes: 1 addition & 1 deletion mimic/util/helper.py
Expand Up @@ -22,7 +22,7 @@ def random_ipv4(*numbers):
address.
"""
all_numbers = [text_type(num) for num in
list(numbers) + [randint(1, 255) for _ in range(4)]]
list(numbers) + [randint(0, 255) for _ in range(4)]]
return ".".join(all_numbers[:4])


Expand Down

0 comments on commit 2132def

Please sign in to comment.