Ejemplo n.º 1
0
 def test_address_with_port_parameter(self):
     addr = '127.0.0.1'
     port = 65432
     res = migration._cannonize_host_port(addr, port)
     self._assert_is_ip_address_with_port(res)
     # address must include the given port
     self.assertTrue(res.endswith(str(port)))
Ejemplo n.º 2
0
 def test_address_with_port_parameter(self):
     addr = '127.0.0.1'
     port = 65432
     res = migration._cannonize_host_port(addr, port)
     self._assert_is_ip_address_with_port(res)
     # address must include the given port
     assert res.endswith(str(port))
Ejemplo n.º 3
0
 def test_address_with_bad_port_parameter(self):
     addr = '127.0.0.1'
     port = '65432'
     with pytest.raises(TypeError):
         migration._cannonize_host_port(addr, port)
Ejemplo n.º 4
0
 def test_address_with_port(self):
     address = "127.0.0.1:65432"
     assert address == migration._cannonize_host_port(address)
Ejemplo n.º 5
0
 def test_address_no_port(self):
     self._assert_is_ip_address_with_port(
         migration._cannonize_host_port('127.0.0.1'))
Ejemplo n.º 6
0
 def test_none_argument_and_port(self):
     port = 65432
     res = migration._cannonize_host_port(None, port)
     self._assert_is_ip_address_with_port(res)
     # address must include the given port
     assert res.endswith(str(port))
Ejemplo n.º 7
0
 def test_none_argument(self):
     self._assert_is_ip_address_with_port(
         migration._cannonize_host_port(None))
Ejemplo n.º 8
0
 def test_address_with_port(self):
     address = "127.0.0.1:65432"
     self.assertEqual(address, migration._cannonize_host_port(address))
Ejemplo n.º 9
0
 def test_address_with_port(self):
     address = "127.0.0.1:65432"
     self.assertEqual(address, migration._cannonize_host_port(address))
Ejemplo n.º 10
0
 def test_address_no_port(self):
     self._assert_is_ip_address_with_port(
         migration._cannonize_host_port('127.0.0.1'))
Ejemplo n.º 11
0
 def test_none_argument_and_port(self):
     port = 65432
     res = migration._cannonize_host_port(None, port)
     self._assert_is_ip_address_with_port(res)
     # address must include the given port
     self.assertTrue(res.endswith(str(port)))
Ejemplo n.º 12
0
 def test_none_argument(self):
     self._assert_is_ip_address_with_port(
         migration._cannonize_host_port(None))