def test_ephemeral_ports_bad2(self): with self.assertRaises(ValueError) as ctx: _validate_ports_low_level("not even a list") self.assertIn( "'ports' must be a list of strings", str(ctx.exception), )
def test_ephemeral_ports_not_strings(self): with self.assertRaises(ValueError) as ctx: _validate_ports_low_level([(80, "127.0.0.1:80")]) self.assertIn( "'ports' must be a list of strings", str(ctx.exception) )