def test_project_put_on_created_project(controller): """ Test a put on a remote servers. The project is already created on the server """ uuid = uuid4() project = Project() project._created = True project.setId(uuid) project.put("/test", lambda: 0, body={"test": "test"}) mock = controller._http_client.createHTTPQuery args, kwargs = mock.call_args assert args[0] == "PUT" assert args[1] == "/projects/{uuid}/test".format(uuid=uuid) assert kwargs["body"] == {"test": "test"}
def test_project_put_on_created_project(controller): """ Test a put on a remote servers. The project is already created on the server """ uuid = uuid4() project = Project() project._created = True project.setId(uuid) project.put("/test", lambda: 0, body={"test": "test"}) mock = controller._http_client.createHTTPQuery args, kwargs = mock.call_args assert args[0] == "PUT" assert args[1] == "/projects/{uuid}/test".format(uuid=uuid) assert kwargs["body"] == {"test": "test"}
def test_project_put_on_created_project(local_server): """ Test a put on a remote servers. The project is already created on the server """ uuid = uuid4() project = Project() project._created_servers = set((local_server, )) project.setId(uuid) with patch("gns3.http_client.HTTPClient.createHTTPQuery") as mock: project.put(local_server, "/test", lambda: 0, body={"test": "test"}) args, kwargs = mock.call_args assert args[0] == "PUT" assert args[1] == "/projects/{uuid}/test".format(uuid=uuid) assert kwargs["body"] == {"test": "test"}
def test_project_put_on_created_project(local_server): """ Test a put on a remote servers. The project is already created on the server """ uuid = uuid4() project = Project() project._created_servers = set((local_server, )) project.setId(uuid) with patch("gns3.http_client.HTTPClient.createHTTPQuery") as mock: project.put(local_server, "/test", lambda: 0, body={"test": "test"}) args, kwargs = mock.call_args assert args[0] == "PUT" assert args[1] == "/projects/{uuid}/test".format(uuid=uuid) assert kwargs["body"] == {"test": "test"}