diff --git a/fuelclient/tests/unit/v2/lib/test_deployment_graph.py b/fuelclient/tests/unit/v2/lib/test_deployment_graph.py index 92f0554b..1e949806 100644 --- a/fuelclient/tests/unit/v2/lib/test_deployment_graph.py +++ b/fuelclient/tests/unit/v2/lib/test_deployment_graph.py @@ -124,10 +124,40 @@ class TestDeploymentGraphFacade(test_api.BaseLibTest): self.client.list(1) self.assertTrue(matcher_get.called) - def test_graphs_download(self): + def test_graphs_download_all(self): matcher_get = self.m_request.get( '/api/v1/clusters/1/deployment_tasks/?graph_type=custom_graph', json=[] ) - self.client.download(env_id=1, level='all', graph_type='custom_graph') + self.client.download(env_id=1, level='all', + graph_type='custom_graph') + self.assertTrue(matcher_get.called) + + def test_graphs_download_release(self): + matcher_get = self.m_request.get( + '/api/v1/clusters/1/deployment_tasks/' + 'release/?graph_type=custom_graph', + json=[] + ) + self.client.download(env_id=1, level='release', + graph_type='custom_graph') + self.assertTrue(matcher_get.called) + + def test_graphs_download_plugins(self): + matcher_get = self.m_request.get( + '/api/v1/clusters/1/deployment_tasks/' + 'plugins/?graph_type=custom_graph', + json=[] + ) + self.client.download(env_id=1, level='plugins', + graph_type='custom_graph') + self.assertTrue(matcher_get.called) + + def test_graphs_download_cluster(self): + matcher_get = self.m_request.get( + '/api/v1/clusters/1/deployment_graphs/custom_graph', + json={'tasks': []} + ) + self.client.download(env_id=1, level='cluster', + graph_type='custom_graph') self.assertTrue(matcher_get.called) diff --git a/fuelclient/v1/graph.py b/fuelclient/v1/graph.py index c1b73b51..95654b22 100644 --- a/fuelclient/v1/graph.py +++ b/fuelclient/v1/graph.py @@ -110,7 +110,7 @@ class GraphClient(base_v1.BaseV1Client): def get_release_tasks_for_cluster(self, env_id, graph_type=None): return self.connection.get_request( - self.merged_plugins_tasks_api_path.format( + self.cluster_release_tasks_api_path.format( env_id=env_id, graph_type=graph_type or ""))