Skip to content

Commit

Permalink
configs: AWS_PROFILE_INFO, iot_logger -> iot-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed Mar 14, 2024
1 parent 5b07231 commit 6609e50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/otaclient_iot_logging_server/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ConfigurableLoggingServerConfig(BaseSettings):
GREENGRASS_V1_CONFIG: str = "/greengrass/config/config.json"
GREENGRASS_V2_CONFIG: str = "/greengrass/v2/init_config/config.yaml"

AWS_PROFILE_INFO: str = "/opt/ota/iot_logger/aws_profile_info.yaml"
AWS_PROFILE_INFO: str = "/opt/ota/iot-logger/aws_profile_info.yaml"
"""The path to aws_profile_info.yaml."""

LISTEN_ADDRESS: str = "127.0.0.1"
Expand Down
6 changes: 5 additions & 1 deletion tests/test_aws_iot_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,18 @@ def setup_test(self, prepare_test_data, mocker: MockerFixture):
get_log_stream_name_mock = mocker.MagicMock(wraps=lambda x, y: y)
mocker.patch(f"{MODULE}.get_log_stream_name", get_log_stream_name_mock)

def test_thread_main(self):
def test_thread_main(self, mocker: MockerFixture):
func_to_test = AWSIoTLogger.thread_main
self._create_log_group = mocked__create_log_group = mocker.MagicMock(
spec=AWSIoTLogger._create_log_group
)

# ------ execution ------ #
with pytest.raises(self._TestFinished):
func_to_test.__get__(self)()
logger.info("execution finished")

# ------ check result ------ #
mocked__create_log_group.assert_called_once()
# confirm the send_messages mock receives the expecting calls.
assert self._merged_msgs == self._test_result
4 changes: 2 additions & 2 deletions tests/test_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{
"GREENGRASS_V1_CONFIG": "/greengrass/config/config.json",
"GREENGRASS_V2_CONFIG": "/greengrass/v2/init_config/config.yaml",
"AWS_PROFILE_INFO": "/opt/ota/iot_logger/aws_profile_info.yaml",
"AWS_PROFILE_INFO": "/opt/ota/iot-logger/aws_profile_info.yaml",
"LISTEN_ADDRESS": "127.0.0.1",
"LISTEN_PORT": 8083,
"UPLOAD_LOGGING_SERVER_LOGS": False,
Expand All @@ -64,7 +64,7 @@
{
"GREENGRASS_V1_CONFIG": "/greengrass/config/config.json",
"GREENGRASS_V2_CONFIG": "/greengrass/v2/init_config/config.yaml",
"AWS_PROFILE_INFO": "/opt/ota/iot_logger/aws_profile_info.yaml",
"AWS_PROFILE_INFO": "/opt/ota/iot-logger/aws_profile_info.yaml",
"LISTEN_ADDRESS": "172.16.1.1",
"LISTEN_PORT": 8083,
"UPLOAD_LOGGING_SERVER_LOGS": False,
Expand Down

0 comments on commit 6609e50

Please sign in to comment.