Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move bridgechain show endpoint #111

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions client/api/bridgechains.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ def all(self, page=None, limit=100, **kwargs):
}
return self.request_get('bridgechains', params)

def get(self, bridgechain_id):
return self.request_get('bridgechains/{}'.format(bridgechain_id))

def search(self, criteria, page=None, limit=100):
params = {
'page': page,
Expand Down
3 changes: 3 additions & 0 deletions client/api/businesses.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def bridgechains(self, business_id, page=None, limit=100):
}
return self.request_get('businesses/{}/bridgechains'.format(business_id), params)

def bridgechain(self, business_id, bridgechain_id):
return self.request_get('businesses/{}/bridgechains/{}'.format(business_id, bridgechain_id))

def search(self, criteria, page=None, limit=100):
params = {
'page': page,
Expand Down
16 changes: 0 additions & 16 deletions tests/api/test_bridgechains.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,6 @@ def test_all_calls_correct_url_with_additional_params():
assert 'orderBy=id' in responses.calls[0].request.url


def test_get_calls_correct_url():
bridgechain_id = '12345'
responses.add(
responses.GET,
'http://127.0.0.1:4002/bridgechains/{}'.format(bridgechain_id),
json={'success': True},
status=200
)

client = ArkClient('http://127.0.0.1:4002')
client.bridgechains.get(bridgechain_id)

assert len(responses.calls) == 1
assert responses.calls[0].request.url == 'http://127.0.0.1:4002/bridgechains/12345'


def test_search_calls_correct_url_with_default_params():
responses.add(
responses.POST,
Expand Down
17 changes: 17 additions & 0 deletions tests/api/test_businesses.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,23 @@ def test_bridgechains_calls_correct_url_with_passed_in_params():
assert 'limit=69' in responses.calls[0].request.url


def test_bridgechain_calls_correct_url():
business_id = '12345'
bridgechain_id = '12345'
responses.add(
responses.GET,
'http://127.0.0.1:4002/businesses/{}/bridgechains/{}'.format(business_id, bridgechain_id),
json={'success': True},
status=200
)

client = ArkClient('http://127.0.0.1:4002')
client.businesses.bridgechain(business_id, bridgechain_id)

assert len(responses.calls) == 1
assert responses.calls[0].request.url == 'http://127.0.0.1:4002/businesses/12345/bridgechains/12345'


def test_search_calls_correct_url_with_default_params():
responses.add(
responses.POST,
Expand Down