File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ def split_port(port):
67
67
68
68
if len (parts ) == 1 :
69
69
internal_port , = parts
70
+ if not internal_port :
71
+ _raise_invalid_port (port )
70
72
return to_port_range (internal_port ), None
71
73
if len (parts ) == 2 :
72
74
external_port , internal_port = parts
Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ def test_info(self):
23
23
self .assertIn ('Containers' , res )
24
24
self .assertIn ('Images' , res )
25
25
self .assertIn ('Debug' , res )
26
- print (res )
27
- self .fail ()
28
26
29
27
30
28
class LoadConfigTest (BaseAPIIntegrationTest ):
Original file line number Diff line number Diff line change @@ -578,6 +578,9 @@ def test_with_no_container_port(self):
578
578
self .assertRaises (ValueError ,
579
579
lambda : split_port ("localhost:80:" ))
580
580
581
+ def test_split_port_empty_string (self ):
582
+ self .assertRaises (ValueError , lambda : split_port ("" ))
583
+
581
584
def test_build_port_bindings_with_one_port (self ):
582
585
port_bindings = build_port_bindings (["127.0.0.1:1000:1000" ])
583
586
self .assertEqual (port_bindings ["1000" ], [("127.0.0.1" , "1000" )])
You can’t perform that action at this time.
0 commit comments