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

add slash if not existant in base url #73

Merged
merged 1 commit into from
Jul 19, 2024
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
7 changes: 7 additions & 0 deletions test_tsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ def test_fetch_traces(self):
self._delete_experiments()
self._delete_traces()

def test_fetch_with_other_client(self):
"""Expect client without end slash to respond with no traces"""
tsp_client = TspClient('http://localhost:8080/tsp/api')
response = tsp_client.fetch_traces()
assert response.status_code == 200
assert not response.model.traces

def test_fetch_traces_none(self):
"""Expect no traces without opening any."""
response = self.tsp_client.fetch_traces()
Expand Down
2 changes: 1 addition & 1 deletion tsp/tsp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, base_url):
'''
Constructor
'''
self.base_url = base_url
self.base_url = base_url if base_url.endswith('/') else base_url + '/'

def fetch_traces(self):
'''
Expand Down