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)))
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))
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)
def test_address_with_port(self): address = "127.0.0.1:65432" assert address == migration._cannonize_host_port(address)
def test_address_no_port(self): self._assert_is_ip_address_with_port( migration._cannonize_host_port('127.0.0.1'))
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))
def test_none_argument(self): self._assert_is_ip_address_with_port( migration._cannonize_host_port(None))
def test_address_with_port(self): address = "127.0.0.1:65432" self.assertEqual(address, migration._cannonize_host_port(address))
def test_address_with_port(self): address = "127.0.0.1:65432" self.assertEqual(address, migration._cannonize_host_port(address))
def test_address_no_port(self): self._assert_is_ip_address_with_port( migration._cannonize_host_port('127.0.0.1'))
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)))
def test_none_argument(self): self._assert_is_ip_address_with_port( migration._cannonize_host_port(None))