From 63eeb96b0fbfed0fb3f5c098858674373343f19d Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Fri, 19 Aug 2022 12:00:26 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=82=8F=E3=81=8B=E3=82=8A=E3=82=84?= =?UTF-8?q?=E3=81=99=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/crm-datafetch/pytest.ini | 3 +++ ecs/crm-datafetch/tests/test_walk_through.py | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 ecs/crm-datafetch/pytest.ini diff --git a/ecs/crm-datafetch/pytest.ini b/ecs/crm-datafetch/pytest.ini new file mode 100644 index 00000000..5dbe2661 --- /dev/null +++ b/ecs/crm-datafetch/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +log_format = %(levelname)s %(asctime)s %(message)s +log_date_format = %Y-%m-%d %H:%M:%S diff --git a/ecs/crm-datafetch/tests/test_walk_through.py b/ecs/crm-datafetch/tests/test_walk_through.py index 51071707..42da7fa4 100644 --- a/ecs/crm-datafetch/tests/test_walk_through.py +++ b/ecs/crm-datafetch/tests/test_walk_through.py @@ -1,4 +1,5 @@ import json +import logging import os import os.path as path from datetime import datetime, timezone @@ -79,7 +80,15 @@ def test_walk_through(s3_test, s3_client, monkeypatch, caplog): monkeypatch.setattr('src.prepare_data_fetch_process.ExecuteDateTime', MockExecuteDateTime) # Act + logger = logging.getLogger() + logger.setLevel(logging.INFO) + logger.info(f'##########################') + logger.info(f'# 差分データ取得処理:実行開始 #') + logger.info(f'##########################') controller() + logger.info(f'##########################') + logger.info(f'# 差分データ取得処理:実行終了 #') + logger.info(f'##########################') # Assertion log_messages = caplog.messages # ループ前のログ確認 @@ -129,7 +138,13 @@ def test_walk_through(s3_test, s3_client, monkeypatch, caplog): # 全件取得用に環境変数を設定 monkeypatch.setattr('src.aws.s3.OBJECT_INFO_FILENAME', 'crm_object_list_all.json') + logger.info(f'##########################') + logger.info(f'# 全件データ取得処理:実行開始 #') + logger.info(f'##########################') controller() + logger.info(f'##########################') + logger.info(f'# 全件データ取得処理:実行終了 #') + logger.info(f'##########################') # ログ再取得 log_messages_all = caplog.messages object_info_list_all = object_info_files[1]