fix: JSON内の日本語がHexコード値で出力されている問題を修正
This commit is contained in:
parent
7a194b8585
commit
570d229c83
@ -87,7 +87,7 @@ class BackupBucket:
|
||||
|
||||
def put_response_json(self, file_path: str, data: dict) -> None:
|
||||
object_key = f'{RESPONSE_JSON_BACKUP_FOLDER}/{file_path}'
|
||||
self.__s3_resource.put_object(object_key, json.dumps(data))
|
||||
self.__s3_resource.put_object(object_key, json.dumps(data, ensure_ascii=False))
|
||||
return
|
||||
|
||||
def put_csv(self, file_path: str, data: str) -> None:
|
||||
@ -97,5 +97,5 @@ class BackupBucket:
|
||||
|
||||
def put_result_json(self, file_path: str, data: dict) -> None:
|
||||
object_key = f'{PROCESS_RESULT_FOLDER}/{file_path}'
|
||||
self.__s3_resource.put_object(object_key, json.dumps(data))
|
||||
self.__s3_resource.put_object(object_key, json.dumps(data, ensure_ascii=False))
|
||||
return
|
||||
|
||||
@ -44,7 +44,8 @@ class TestBackupCrmDataProcess:
|
||||
('LastModifiedDate', '2022-06-01T00:00:00.000+0000'),
|
||||
('LastModifiedById', 1.234567E+6),
|
||||
('SystemModstamp', '2022-06-01T00:00:00.000+0000'),
|
||||
('IsDeleted', False)
|
||||
('IsDeleted', False),
|
||||
('Name', 'テスト取引先1')
|
||||
]),
|
||||
OrderedDict([
|
||||
('attributes', OrderedDict([('type', 'Account'),
|
||||
@ -54,7 +55,8 @@ class TestBackupCrmDataProcess:
|
||||
('LastModifiedDate', '2022-06-01T00:00:00.000+0000'),
|
||||
('LastModifiedById', 1.234567E+6),
|
||||
('SystemModstamp', '2022-06-01T00:00:00.000+0000'),
|
||||
('IsDeleted', False)
|
||||
('IsDeleted', False),
|
||||
('Name', 'テスト取引先2')
|
||||
]),
|
||||
OrderedDict([
|
||||
('attributes', OrderedDict([('type', 'Account'),
|
||||
@ -64,7 +66,8 @@ class TestBackupCrmDataProcess:
|
||||
('LastModifiedDate', '2022-06-01T00:00:00.000+0000'),
|
||||
('LastModifiedById', 1.234567E+6),
|
||||
('SystemModstamp', '2022-06-01T00:00:00.000+0000'),
|
||||
('IsDeleted', False)
|
||||
('IsDeleted', False),
|
||||
('Name', 'テスト取引先3')
|
||||
]),
|
||||
]
|
||||
|
||||
@ -96,7 +99,7 @@ class TestBackupCrmDataProcess:
|
||||
actual = s3_client.get_object(
|
||||
Bucket=bucket_name,
|
||||
Key=f'response_json/{execute_datetime.to_path()}/CRM_Account_{execute_datetime.format_date()}.json')
|
||||
assert actual['Body'].read().decode('utf-8') == json.dumps(response_json)
|
||||
assert actual['Body'].read().decode('utf-8') == json.dumps(response_json, ensure_ascii=False)
|
||||
|
||||
# ログの確認
|
||||
assert generate_log_message_tuple(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user