Skip to content

Commit 6c79a06

Browse files
authored
Merge pull request #15 from ByteInternet/use-new-brancher-app-endpoint
use-new-brancher-app-endpoint
2 parents 5116bcb + 96d7871 commit 6c79a06

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

hypernode_api_python/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
HYPERNODE_API_APP_DETAIL_WITH_ADDONS_ENDPOINT = "/v2/app/{}/with_addons?destroyed=false"
1010
HYPERNODE_API_APP_EAV_DESCRIPTION_ENDPOINT = "/v2/app/eav_descriptions/"
1111
HYPERNODE_API_APP_FLAVOR_ENDPOINT = "/v2/app/{}/flavor/"
12-
HYPERNODE_API_APP_BRANCHER_ENDPOINT = "/v2/app/{}/brancher/"
12+
HYPERNODE_API_BRANCHER_APP_ENDPOINT = "/v2/brancher/app/{}/"
1313
HYPERNODE_API_BRANCHER_ENDPOINT = "/v2/brancher/{}/"
1414
HYPERNODE_API_APP_NEXT_BEST_PLAN_ENDPOINT = "/v2/app/{}/next_best_plan/"
1515
HYPERNODE_API_APP_PRODUCT_LIST_ENDPOINT = "/v2/product/app/{}/"
@@ -667,7 +667,7 @@ def get_active_branchers(self, app_name):
667667
:return obj response: The request response object
668668
"""
669669
return self.requests(
670-
"GET", HYPERNODE_API_APP_BRANCHER_ENDPOINT.format(app_name)
670+
"GET", HYPERNODE_API_BRANCHER_APP_ENDPOINT.format(app_name)
671671
)
672672

673673
def create_brancher(self, app_name, data):
@@ -680,7 +680,7 @@ def create_brancher(self, app_name, data):
680680
:return obj response: The request response object
681681
"""
682682
return self.requests(
683-
"POST", HYPERNODE_API_APP_BRANCHER_ENDPOINT.format(app_name), data=data
683+
"POST", HYPERNODE_API_BRANCHER_APP_ENDPOINT.format(app_name), data=data
684684
)
685685

686686
def destroy_brancher(self, brancher_name):

tests/client/test_create_brancher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from unittest.mock import Mock
33

44
from hypernode_api_python.client import (
5-
HYPERNODE_API_APP_BRANCHER_ENDPOINT,
5+
HYPERNODE_API_BRANCHER_APP_ENDPOINT,
66
HypernodeAPIPython,
77
)
88

@@ -15,14 +15,14 @@ def setUp(self):
1515
self.app_name = "my_app"
1616

1717
def test_brancher_endpoint_is_correct(self):
18-
self.assertEqual("/v2/app/{}/brancher/", HYPERNODE_API_APP_BRANCHER_ENDPOINT)
18+
self.assertEqual("/v2/brancher/app/{}/", HYPERNODE_API_BRANCHER_APP_ENDPOINT)
1919

2020
def test_calls_create_brancher_endpoint_properly(self):
2121
data = {"clear_services": ["mysql"]}
2222
self.client.create_brancher(self.app_name, data)
2323

2424
self.mock_request.assert_called_once_with(
25-
"POST", f"/v2/app/{self.app_name}/brancher/", data=data
25+
"POST", f"/v2/brancher/app/{self.app_name}/", data=data
2626
)
2727

2828
def test_returns_create_brancher_data(self):

tests/client/test_get_active_branchers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from unittest.mock import Mock
33

44
from hypernode_api_python.client import (
5-
HYPERNODE_API_APP_BRANCHER_ENDPOINT,
5+
HYPERNODE_API_BRANCHER_APP_ENDPOINT,
66
HypernodeAPIPython,
77
)
88

@@ -15,13 +15,13 @@ def setUp(self):
1515
self.app_name = "my_app"
1616

1717
def test_brancher_endpoint_is_correct(self):
18-
self.assertEqual("/v2/app/{}/brancher/", HYPERNODE_API_APP_BRANCHER_ENDPOINT)
18+
self.assertEqual("/v2/brancher/app/{}/", HYPERNODE_API_BRANCHER_APP_ENDPOINT)
1919

2020
def test_calls_get_active_branchers_endpoint_properly(self):
2121
self.client.get_active_branchers(self.app_name)
2222

2323
self.mock_request.assert_called_once_with(
24-
"GET", f"/v2/app/{self.app_name}/brancher/"
24+
"GET", f"/v2/brancher/app/{self.app_name}/"
2525
)
2626

2727
def test_returns_active_branchers_data(self):

0 commit comments

Comments
 (0)