Skip to content

Commit

Permalink
monkey patch get_basic_auth_token
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere committed Oct 18, 2022
1 parent 348aefe commit 4ad020f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions octavia-cli/octavia_cli/api_http_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ class ApiHttpHeader:
value: str

def __post_init__(self):
self.name = str(self.name)
self.value = str(self.value)
try:
assert len(self.name) > 0
assert len(self.value) > 0
assert isinstance(self.name, str) and self.name
assert isinstance(self.value, str) and self.value
except AssertionError:
raise AttributeError("Header name and value must be non empty string.")
self.name = self.name.strip()
Expand Down
1 change: 1 addition & 0 deletions octavia-cli/unit_tests/test_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def test_octavia_not_initialized(mocker):
)
def test_get_api_client(mocker, api_http_headers: Optional[List[str]]):
mocker.patch.object(entrypoint, "airbyte_api_client")
entrypoint.airbyte_api_client.Configuration.return_value.get_basic_auth_token.return_value = "my_basic_auth_token"
mocker.patch.object(entrypoint, "check_api_health")
mocker.patch.object(entrypoint, "set_api_headers_on_api_client")
api_client = entrypoint.get_api_client("test-url", "test-username", "test-password", "test-user-agent", api_http_headers)
Expand Down

0 comments on commit 4ad020f

Please sign in to comment.