Skip to content
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
4 changes: 2 additions & 2 deletions eric-oss-hello-world-python-app/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def tls_login(url, headers):
cert = (app_cert, app_key)

try:
with open(client_id_path, "r") as f:
with open(client_id_path, "r", encoding="utf-8") as f:
form_data["client_id"] = f.read().strip()
except OSError as e:
raise LoginError(f"Error while reading client id: {e}")
raise LoginError(f"Error while reading client id: {e}") from e

try:
response = requests.post(
Expand Down
2 changes: 2 additions & 0 deletions eric-oss-hello-world-python-app/tests/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from login import login, LoginError
import pytest


def test_login_receives_token_x509(mock_login_api, config):
# pylint: disable=unused-argument
"""Check if we receive a token"""
token, expiry = login()
assert token == "2YotnFZFEjr1zCsicMWpAA" and expiry > time.time()
Expand Down
1 change: 0 additions & 1 deletion eric-oss-hello-world-python-app/tests/test_mtls_logging.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Tests which cover the app's logging, both to STDOUT and to Log Aggregator"""

import builtins
import json
from unittest import mock
import requests
Expand Down