def test_api_url_passive(self): model = Agent( hostname="foo", port=12345, remote_ip="10.56.0.1", ram=1024, free_ram=128, cpus=4, use_address=UseAgentAddress.PASSIVE) # Shouldn't have access to api_url if we're operating under PASSIVE with self.assertRaises(ValueError): model.api_url()
def test_api_url_passive(self): model = Agent(hostname="foo", port=12345, remote_ip="10.56.0.1", ram=1024, free_ram=128, cpus=4, use_address=UseAgentAddress.PASSIVE) # Shouldn't have access to api_url if we're operating under PASSIVE with self.assertRaises(ValueError): model.api_url()
def test_api_url_hostname(self): model = Agent(hostname="foo", port=12345, remote_ip="10.56.0.1", ram=1024, free_ram=128, cpus=4, use_address=UseAgentAddress.HOSTNAME) self.assertEqual( model.api_url(), model.URL_TEMPLATE.format(host=model.hostname, port=model.port))
def test_api_url_hostname(self): model = Agent( hostname="foo", port=12345, remote_ip="10.56.0.1", ram=1024, free_ram=128, cpus=4, use_address=UseAgentAddress.HOSTNAME) self.assertEqual( model.api_url(), model.URL_TEMPLATE.format( host=model.hostname, port=model.port ) )