-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Initially reported as docker/compose#1887
Example:
def test_port_only_with_colon(self):
self.assertRaises(ValueError,
lambda: split_port(":80"))
def test_host_only_with_colon(self):
self.assertRaises(ValueError,
lambda: split_port("localhost:"))
Results:
======================================================================
ERROR: test_host_only_with_colon (__main__.UtilsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/utils_test.py", line 428, in test_host_only_with_colon
lambda: split_port("localhost:"))
File "/usr/lib/python2.7/unittest/case.py", line 473, in assertRaises
callableObj(*args, **kwargs)
File "tests/utils_test.py", line 428, in <lambda>
lambda: split_port("localhost:"))
File "/home/mark/Projects/docker-py/docker/utils/ports/ports.py", line 77, in split_port
if len(internal_range) != len(external_range):
TypeError: object of type 'NoneType' has no len()
======================================================================
ERROR: test_port_only_with_colon (__main__.UtilsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/utils_test.py", line 424, in test_port_only_with_colon
lambda: split_port(":80"))
File "/usr/lib/python2.7/unittest/case.py", line 473, in assertRaises
callableObj(*args, **kwargs)
File "tests/utils_test.py", line 424, in <lambda>
lambda: split_port(":80"))
File "/home/mark/Projects/docker-py/docker/utils/ports/ports.py", line 77, in split_port
if len(internal_range) != len(external_range):
TypeError: object of type 'NoneType' has no len()
Metadata
Metadata
Assignees
Labels
No labels