python 2.6 compatible

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
This commit is contained in:
Yuval Kohavi 2015-04-11 07:17:28 -05:00
parent 8028c988ce
commit b33052b393
1 changed files with 3 additions and 6 deletions

View File

@ -215,16 +215,13 @@ class UtilsTest(unittest.TestCase):
[("127.0.0.1", "1000"), ("127.0.0.1", "1001")])
def test_split_port_invalid(self):
with self.assertRaises(ValueError):
split_port("0.0.0.0:1000:2000:tcp")
self.assertRaises(ValueError, lambda: split_port("0.0.0.0:1000:2000:tcp"))
def test_non_matching_length_port_ranges(self):
with self.assertRaises(ValueError):
split_port("0.0.0.0:1000-1010:2000-2002/tcp")
self.assertRaises(ValueError, lambda: split_port("0.0.0.0:1000-1010:2000-2002/tcp"))
def test_port_and_range_invalid(self):
with self.assertRaises(ValueError):
split_port("0.0.0.0:1000:2000-2002/tcp")
self.assertRaises(ValueError, lambda: split_port("0.0.0.0:1000:2000-2002/tcp"))
def test_build_port_bindings_with_one_port(self):
port_bindings = build_port_bindings(["127.0.0.1:1000:1000"])