Skip to content

Commit

Permalink
Refactor token name to be URL-safe
Browse files Browse the repository at this point in the history
Fix logical error in unit test
  • Loading branch information
NeonDaniel committed Nov 13, 2024
1 parent f962b15 commit 1b04d04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion neon_utils/hana_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _get_token(backend_address: str):
hana_config = Configuration().get('hana', {})
username = hana_config.get("username") or "guest"
password = hana_config.get("password") or "password"
token_name = f"{gethostname()} {datetime.utcnow().isoformat()}"
token_name = f"{gethostname()}_{datetime.utcnow().isoformat()}"
resp = requests.post(f"{backend_address}/auth/login",
json={"username": username,
"password": password,
Expand Down
2 changes: 1 addition & 1 deletion tests/hana_util_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_00_get_token(self, config, config_path):

# Test with configured invalid login
config.return_value = {"hana": {"username": "guest",
"password": "password"}}
"password": "fake_password"}}
from neon_utils.hana_utils import ServerException
with self.assertRaises(ServerException):
_get_token(self.test_server)
Expand Down

0 comments on commit 1b04d04

Please sign in to comment.