Skip to content

Commit

Permalink
Merge pull request #163 from JCHacking/issue#162
Browse files Browse the repository at this point in the history
fix: Calls with double /
  • Loading branch information
gardusig authored May 10, 2023
2 parents 640f4d2 + 498a7ed commit e01cab2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/conductor/client/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(
if server_api_url != None:
self.host = server_api_url
else:
self.host = base_url + '/api/'
self.host = base_url + '/api'

self.temp_folder_path = None

Expand Down
12 changes: 6 additions & 6 deletions tests/unit/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_initialization_default(self):
configuration = Configuration()
self.assertEqual(
configuration.host,
'http://localhost:8080/api/'
'http://localhost:8080/api'
)

def test_initialization_with_base_url(self):
Expand All @@ -18,24 +18,24 @@ def test_initialization_with_base_url(self):
)
self.assertEqual(
configuration.host,
'https://play.orkes.io/api/'
'https://play.orkes.io/api'
)

def test_initialization_with_server_api_url(self):
configuration = Configuration(
server_api_url='https://play.orkes.io/api/'
server_api_url='https://play.orkes.io/api'
)
self.assertEqual(
configuration.host,
'https://play.orkes.io/api/'
'https://play.orkes.io/api'
)

def test_initialization_with_basic_auth_server_api_url(self):
configuration = Configuration(
server_api_url="https://user:[email protected]/api/"
server_api_url="https://user:[email protected]/api"
)
basic_auth = "user:password"
expected_host = f"https://{basic_auth}@play.orkes.io/api/"
expected_host = f"https://{basic_auth}@play.orkes.io/api"
self.assertEqual(
configuration.host, expected_host,
)
Expand Down

0 comments on commit e01cab2

Please sign in to comment.