Endpoint for obtaining direct action on compute

This commit is contained in:
ziajka committed 2017-10-13 11:03:56 +02:00
1 parent e52b83be11
commit b654d78ea6
5 files changed
+69 -1

No files matched your search

+7
View File
@@ -55,6 +55,13 @@ def test_getUrl(controller):
assert compute._getUrl("/test") == "https://[::1]:84/v2/compute/test"
def test_get_url(controller):
compute = Compute("my_compute_id", protocol="https", host="localhost", port=84, controller=controller)
with patch('gns3server.controller.compute.Compute._getUrl', return_value="returned") as getURL:
assert compute.get_url("/test") == 'returned'
getURL.assert_called_once_with('/test')
def test_host_ip(controller):
compute = Compute("my_compute_id", protocol="https", host="localhost", port=84, controller=controller)
assert compute.host_ip == "127.0.0.1"