From 4d179f6be5aef52e113b24c963670643d13bdc55 Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Mon, 22 Aug 2022 11:35:00 +0900 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E6=8C=87=E6=95=B0=E8=A1=A8=E8=A8=98?= =?UTF-8?q?=E3=81=AE=E5=A4=89=E6=8F=9B=E3=82=92=E8=A1=8C=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=93=E3=81=A8=E3=81=AB=E3=82=88=E3=82=8A?= =?UTF-8?q?=E3=80=81=E4=BB=96=E3=81=AE=E5=B0=91=E6=95=B0=E9=A0=85=E7=9B=AE?= =?UTF-8?q?=E3=81=8C=E6=95=B4=E6=95=B0=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/converter/convert_strategy.py | 10 ----- .../tests/converter/test_convert_strategy.py | 44 +++++++++---------- .../tests/converter/test_converter.py | 10 ++--- .../test_convert_crm_csv_data_process.py | 10 ++--- 4 files changed, 31 insertions(+), 43 deletions(-) diff --git a/ecs/crm-datafetch/src/converter/convert_strategy.py b/ecs/crm-datafetch/src/converter/convert_strategy.py index 22fca8fc..ab1e0626 100644 --- a/ecs/crm-datafetch/src/converter/convert_strategy.py +++ b/ecs/crm-datafetch/src/converter/convert_strategy.py @@ -12,7 +12,6 @@ from src.system_var.environments import CONVERT_TZ class ConvertStrategyFactory: def __init__(self) -> None: self.__none_value_convert_strategy = NoneValueConvertStrategy() - self.__float_convert_strategy = FloatConvertStrategy() self.__boolean_convert_strategy = BooleanConvertStrategy() self.__datetime_convert_strategy = DatetimeConvertStrategy() self.__int_convert_strategy = IntConvertStrategy() @@ -23,9 +22,6 @@ class ConvertStrategyFactory: if value is None: convert_strategy = self.__none_value_convert_strategy - elif type(value) == float: - convert_strategy = self.__float_convert_strategy - elif type(value) == bool: convert_strategy = self.__boolean_convert_strategy @@ -60,12 +56,6 @@ class DatetimeConvertStrategy: return datetime.strptime(convert_value, CRM_DATETIME_FORMAT).astimezone(gettz(CONVERT_TZ)).strftime(YYYYMMDDHHMMSS) -class FloatConvertStrategy: - def convert_value(self, convert_value: str) -> int: - """float型をint型に変換する処理""" - return int(convert_value) - - class IntConvertStrategy: def convert_value(self, convert_value: int): """int型を変換せずに返す処理""" diff --git a/ecs/crm-datafetch/tests/converter/test_convert_strategy.py b/ecs/crm-datafetch/tests/converter/test_convert_strategy.py index 0e268fc4..4b4552a8 100644 --- a/ecs/crm-datafetch/tests/converter/test_convert_strategy.py +++ b/ecs/crm-datafetch/tests/converter/test_convert_strategy.py @@ -1,7 +1,6 @@ from src.converter.convert_strategy import (BooleanConvertStrategy, ConvertStrategyFactory, DatetimeConvertStrategy, - FloatConvertStrategy, IntConvertStrategy, NoneValueConvertStrategy, StringConvertStrategy) @@ -29,7 +28,7 @@ class TestConvertStrategyFactory: def test_create_float(self): """ Cases: - 引数に指数表記を指定した場合、FloatConvertStrategyインスタンスが返ってくること + 引数に指数表記を指定した場合、StringConvertStrategyインスタンスが返ってくること Arranges: - なし Expects: @@ -41,7 +40,26 @@ class TestConvertStrategyFactory: actual = sut.create(1.2345678E7) # Expects - assert type(actual) == FloatConvertStrategy + # 変換しない + assert type(actual) == StringConvertStrategy + + def test_create_float_scale(self): + """ + Cases: + 引数に少数を指定した場合、StringConvertStrategyインスタンスが返ってくること + Arranges: + - なし + Expects: + - 戻り値が、期待値と一致する + """ + + # Act + sut = ConvertStrategyFactory() + actual = sut.create(1.2345678E7) + + # Expects + # 変換しない + assert type(actual) == StringConvertStrategy def test_create_bool_true(self): """ @@ -206,26 +224,6 @@ class TestDatetimeConvertStrategy: assert actual == "2022-06-14 05:15:32" -class TestFloatConvertStrategy: - - def test_convert_value(self) -> int: - """ - Cases: - 引数に指数表記を指定した場合、整数で返ってくること - Arranges: - - なし - Expects: - - 戻り値が、期待値と一致する - """ - - # Act - sut = FloatConvertStrategy() - actual = sut.convert_value(1.2345678E7) - - # Expects - assert actual == 12345678 - - class TestIntConvertStrategy: def test_convert_value(self): diff --git a/ecs/crm-datafetch/tests/converter/test_converter.py b/ecs/crm-datafetch/tests/converter/test_converter.py index 0300381d..da80982b 100644 --- a/ecs/crm-datafetch/tests/converter/test_converter.py +++ b/ecs/crm-datafetch/tests/converter/test_converter.py @@ -71,7 +71,7 @@ class TestCSVStringConverter: ('ContactAccessLevel', 8), ('RowCause', 'テストのため2'), ('LastModifiedDate', '2022-06-02T16:30:30.000+0000'), - ('LastModifiedById', 2.234567E+6), + ('LastModifiedById', 2.23E+0), ('IsDeleted', True) ]), OrderedDict([ @@ -85,7 +85,7 @@ class TestCSVStringConverter: ('ContactAccessLevel', 12), ('RowCause', 'テストのため3'), ('LastModifiedDate', '2022-06-03T23:50:50.000+0000'), - ('LastModifiedById', 3.234567E+6), + ('LastModifiedById', 3.234567), ('IsDeleted', False) ]) ] @@ -100,9 +100,9 @@ class TestCSVStringConverter: # Expects expected_value = '''\ "Id","AccountId","UserOrGroupId","AccountAccessLevel","OpportunityAccessLevel","CaseAccessLevel","ContactAccessLevel","RowCause","LastModifiedDate","LastModifiedById","IsDeleted"\r\n\ - "TEST001","test001","","1","2","3","4","テストのため1","2022-06-01 09:00:00","1234567","0"\r\n\ - "TEST002","test002","","5","6","7","8","テストのため2","2022-06-03 01:30:30","2234567","1"\r\n\ - "TEST003","test003","","9","10","11","12","テストのため3","2022-06-04 08:50:50","3234567","0"\r\n\ + "TEST001","test001","","1","2","3","4","テストのため1","2022-06-01 09:00:00","1234567.0","0"\r\n\ + "TEST002","test002","","5","6","7","8","テストのため2","2022-06-03 01:30:30","2.23","1"\r\n\ + "TEST003","test003","","9","10","11","12","テストのため3","2022-06-04 08:50:50","3.234567","0"\r\n\ ''' # expected_valueのインデントが半角スペースと認識されてしまうため、`textwrap.dedent`にて補正 diff --git a/ecs/crm-datafetch/tests/test_convert_crm_csv_data_process.py b/ecs/crm-datafetch/tests/test_convert_crm_csv_data_process.py index 49d960c0..6d1b63f1 100644 --- a/ecs/crm-datafetch/tests/test_convert_crm_csv_data_process.py +++ b/ecs/crm-datafetch/tests/test_convert_crm_csv_data_process.py @@ -42,7 +42,7 @@ class TestConvertCrmCsvDataProcess: ('Id', 'TEST002'), ('AccountNumber', 'test002'), ('LastModifiedDate', '2022-06-01T00:00:00.000+0000'), - ('LastModifiedById', 1.234567E+6), + ('LastModifiedById', 1.23E+0), ('SystemModstamp', '2022-06-01T00:00:00.000+0000'), ('IsDeleted', False) ]), @@ -52,7 +52,7 @@ class TestConvertCrmCsvDataProcess: ('Id', 'TEST003'), ('AccountNumber', 'test003'), ('LastModifiedDate', '2022-06-01T00:00:00.000+0000'), - ('LastModifiedById', 1.234567E+6), + ('LastModifiedById', 1.234567), ('SystemModstamp', '2022-06-01T00:00:00.000+0000'), ('IsDeleted', False) ]), @@ -80,9 +80,9 @@ class TestConvertCrmCsvDataProcess: expect_csv_string = """\ "Id","AccountNumber","LastModifiedDate","LastModifiedById","SystemModstamp","IsDeleted"\r\n\ - "TEST001","test001","2022-06-01 09:00:00","1234567","2022-06-01 09:00:00","1"\r\n\ - "TEST002","test002","2022-06-01 09:00:00","1234567","2022-06-01 09:00:00","0"\r\n\ - "TEST003","test003","2022-06-01 09:00:00","1234567","2022-06-01 09:00:00","0"\r\n\ + "TEST001","test001","2022-06-01 09:00:00","1234567.0","2022-06-01 09:00:00","1"\r\n\ + "TEST002","test002","2022-06-01 09:00:00","1.23","2022-06-01 09:00:00","0"\r\n\ + "TEST003","test003","2022-06-01 09:00:00","1.234567","2022-06-01 09:00:00","0"\r\n\ """ # 返り値の期待値チェック assert isinstance(actual_csv_string, str), 'CSV文字列が返却される' From f6713f2c094e4fb9232fd81404fbc93ee949c0e9 Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Mon, 22 Aug 2022 11:36:54 +0900 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20salesforce=E3=81=AE=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E5=A4=89=E6=9B=B4=E3=81=AB=E4=BC=B4=E3=81=86?= =?UTF-8?q?=E4=BB=B6=E6=95=B0=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/crm-datafetch/tests/salesforce/test_salesforce.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ecs/crm-datafetch/tests/salesforce/test_salesforce.py b/ecs/crm-datafetch/tests/salesforce/test_salesforce.py index b815e772..4a3667f5 100644 --- a/ecs/crm-datafetch/tests/salesforce/test_salesforce.py +++ b/ecs/crm-datafetch/tests/salesforce/test_salesforce.py @@ -160,7 +160,7 @@ class TestSalesforceApiClient: - LastFetchDatetimeのFromに2000年1月1日を指定する - LastFetchDatetimeのToに2100年12月31日を指定する Expects: - 取得件数が16になる + 取得件数が17になる """ execute_datetime = ExecuteDateTime() @@ -190,7 +190,7 @@ class TestSalesforceApiClient: sut = SalesforceApiClient() actual = sut.fetch_sf_count(soql) - assert actual == 16 + assert actual == 17 def test_fetch_sf_data_one_record(self): """ @@ -433,7 +433,7 @@ class TestSalesforceApiClient: - LastFetchDatetimeのFromに2000年1月1日を指定する - LastFetchDatetimeのToに2100年12月31日を指定する Expects: - 取得できたオブジェクト件数が16件になる + 取得できたオブジェクト件数が17件になる """ execute_datetime = ExecuteDateTime() @@ -463,7 +463,7 @@ class TestSalesforceApiClient: sut = SalesforceApiClient() actual = sut.fetch_sf_data(soql) - assert len(actual) == 16 + assert len(actual) == 17 # 内容の確認は別のケースで行っているため省略 def test_raise_create_instance_cause_auth_failed(self, monkeypatch): From 062ac4daa8e3f9add3b85bbd12ecccee9eb46c1c Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Tue, 23 Aug 2022 11:54:43 +0900 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20=E6=8C=87=E6=95=B0=E8=A1=A8=E8=A8=98?= =?UTF-8?q?=E3=81=AE=E5=A4=89=E6=8F=9B=E3=82=92=E8=A1=8C=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=93=E3=81=A8=E3=81=AB=E3=82=88=E3=82=8A?= =?UTF-8?q?=E3=80=81=E4=BB=96=E3=81=AE=E5=B0=91=E6=95=B0=E9=A0=85=E7=9B=AE?= =?UTF-8?q?=E3=81=8C=E6=95=B4=E6=95=B0=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/converter/convert_strategy.py | 10 ----- .../tests/converter/test_convert_strategy.py | 44 +++++++++---------- .../tests/converter/test_converter.py | 10 ++--- .../test_convert_crm_csv_data_process.py | 10 ++--- 4 files changed, 31 insertions(+), 43 deletions(-) diff --git a/ecs/crm-datafetch/src/converter/convert_strategy.py b/ecs/crm-datafetch/src/converter/convert_strategy.py index 22fca8fc..ab1e0626 100644 --- a/ecs/crm-datafetch/src/converter/convert_strategy.py +++ b/ecs/crm-datafetch/src/converter/convert_strategy.py @@ -12,7 +12,6 @@ from src.system_var.environments import CONVERT_TZ class ConvertStrategyFactory: def __init__(self) -> None: self.__none_value_convert_strategy = NoneValueConvertStrategy() - self.__float_convert_strategy = FloatConvertStrategy() self.__boolean_convert_strategy = BooleanConvertStrategy() self.__datetime_convert_strategy = DatetimeConvertStrategy() self.__int_convert_strategy = IntConvertStrategy() @@ -23,9 +22,6 @@ class ConvertStrategyFactory: if value is None: convert_strategy = self.__none_value_convert_strategy - elif type(value) == float: - convert_strategy = self.__float_convert_strategy - elif type(value) == bool: convert_strategy = self.__boolean_convert_strategy @@ -60,12 +56,6 @@ class DatetimeConvertStrategy: return datetime.strptime(convert_value, CRM_DATETIME_FORMAT).astimezone(gettz(CONVERT_TZ)).strftime(YYYYMMDDHHMMSS) -class FloatConvertStrategy: - def convert_value(self, convert_value: str) -> int: - """float型をint型に変換する処理""" - return int(convert_value) - - class IntConvertStrategy: def convert_value(self, convert_value: int): """int型を変換せずに返す処理""" diff --git a/ecs/crm-datafetch/tests/converter/test_convert_strategy.py b/ecs/crm-datafetch/tests/converter/test_convert_strategy.py index 0e268fc4..4b4552a8 100644 --- a/ecs/crm-datafetch/tests/converter/test_convert_strategy.py +++ b/ecs/crm-datafetch/tests/converter/test_convert_strategy.py @@ -1,7 +1,6 @@ from src.converter.convert_strategy import (BooleanConvertStrategy, ConvertStrategyFactory, DatetimeConvertStrategy, - FloatConvertStrategy, IntConvertStrategy, NoneValueConvertStrategy, StringConvertStrategy) @@ -29,7 +28,7 @@ class TestConvertStrategyFactory: def test_create_float(self): """ Cases: - 引数に指数表記を指定した場合、FloatConvertStrategyインスタンスが返ってくること + 引数に指数表記を指定した場合、StringConvertStrategyインスタンスが返ってくること Arranges: - なし Expects: @@ -41,7 +40,26 @@ class TestConvertStrategyFactory: actual = sut.create(1.2345678E7) # Expects - assert type(actual) == FloatConvertStrategy + # 変換しない + assert type(actual) == StringConvertStrategy + + def test_create_float_scale(self): + """ + Cases: + 引数に少数を指定した場合、StringConvertStrategyインスタンスが返ってくること + Arranges: + - なし + Expects: + - 戻り値が、期待値と一致する + """ + + # Act + sut = ConvertStrategyFactory() + actual = sut.create(1.2345678E7) + + # Expects + # 変換しない + assert type(actual) == StringConvertStrategy def test_create_bool_true(self): """ @@ -206,26 +224,6 @@ class TestDatetimeConvertStrategy: assert actual == "2022-06-14 05:15:32" -class TestFloatConvertStrategy: - - def test_convert_value(self) -> int: - """ - Cases: - 引数に指数表記を指定した場合、整数で返ってくること - Arranges: - - なし - Expects: - - 戻り値が、期待値と一致する - """ - - # Act - sut = FloatConvertStrategy() - actual = sut.convert_value(1.2345678E7) - - # Expects - assert actual == 12345678 - - class TestIntConvertStrategy: def test_convert_value(self): diff --git a/ecs/crm-datafetch/tests/converter/test_converter.py b/ecs/crm-datafetch/tests/converter/test_converter.py index 0300381d..da80982b 100644 --- a/ecs/crm-datafetch/tests/converter/test_converter.py +++ b/ecs/crm-datafetch/tests/converter/test_converter.py @@ -71,7 +71,7 @@ class TestCSVStringConverter: ('ContactAccessLevel', 8), ('RowCause', 'テストのため2'), ('LastModifiedDate', '2022-06-02T16:30:30.000+0000'), - ('LastModifiedById', 2.234567E+6), + ('LastModifiedById', 2.23E+0), ('IsDeleted', True) ]), OrderedDict([ @@ -85,7 +85,7 @@ class TestCSVStringConverter: ('ContactAccessLevel', 12), ('RowCause', 'テストのため3'), ('LastModifiedDate', '2022-06-03T23:50:50.000+0000'), - ('LastModifiedById', 3.234567E+6), + ('LastModifiedById', 3.234567), ('IsDeleted', False) ]) ] @@ -100,9 +100,9 @@ class TestCSVStringConverter: # Expects expected_value = '''\ "Id","AccountId","UserOrGroupId","AccountAccessLevel","OpportunityAccessLevel","CaseAccessLevel","ContactAccessLevel","RowCause","LastModifiedDate","LastModifiedById","IsDeleted"\r\n\ - "TEST001","test001","","1","2","3","4","テストのため1","2022-06-01 09:00:00","1234567","0"\r\n\ - "TEST002","test002","","5","6","7","8","テストのため2","2022-06-03 01:30:30","2234567","1"\r\n\ - "TEST003","test003","","9","10","11","12","テストのため3","2022-06-04 08:50:50","3234567","0"\r\n\ + "TEST001","test001","","1","2","3","4","テストのため1","2022-06-01 09:00:00","1234567.0","0"\r\n\ + "TEST002","test002","","5","6","7","8","テストのため2","2022-06-03 01:30:30","2.23","1"\r\n\ + "TEST003","test003","","9","10","11","12","テストのため3","2022-06-04 08:50:50","3.234567","0"\r\n\ ''' # expected_valueのインデントが半角スペースと認識されてしまうため、`textwrap.dedent`にて補正 diff --git a/ecs/crm-datafetch/tests/test_convert_crm_csv_data_process.py b/ecs/crm-datafetch/tests/test_convert_crm_csv_data_process.py index 49d960c0..6d1b63f1 100644 --- a/ecs/crm-datafetch/tests/test_convert_crm_csv_data_process.py +++ b/ecs/crm-datafetch/tests/test_convert_crm_csv_data_process.py @@ -42,7 +42,7 @@ class TestConvertCrmCsvDataProcess: ('Id', 'TEST002'), ('AccountNumber', 'test002'), ('LastModifiedDate', '2022-06-01T00:00:00.000+0000'), - ('LastModifiedById', 1.234567E+6), + ('LastModifiedById', 1.23E+0), ('SystemModstamp', '2022-06-01T00:00:00.000+0000'), ('IsDeleted', False) ]), @@ -52,7 +52,7 @@ class TestConvertCrmCsvDataProcess: ('Id', 'TEST003'), ('AccountNumber', 'test003'), ('LastModifiedDate', '2022-06-01T00:00:00.000+0000'), - ('LastModifiedById', 1.234567E+6), + ('LastModifiedById', 1.234567), ('SystemModstamp', '2022-06-01T00:00:00.000+0000'), ('IsDeleted', False) ]), @@ -80,9 +80,9 @@ class TestConvertCrmCsvDataProcess: expect_csv_string = """\ "Id","AccountNumber","LastModifiedDate","LastModifiedById","SystemModstamp","IsDeleted"\r\n\ - "TEST001","test001","2022-06-01 09:00:00","1234567","2022-06-01 09:00:00","1"\r\n\ - "TEST002","test002","2022-06-01 09:00:00","1234567","2022-06-01 09:00:00","0"\r\n\ - "TEST003","test003","2022-06-01 09:00:00","1234567","2022-06-01 09:00:00","0"\r\n\ + "TEST001","test001","2022-06-01 09:00:00","1234567.0","2022-06-01 09:00:00","1"\r\n\ + "TEST002","test002","2022-06-01 09:00:00","1.23","2022-06-01 09:00:00","0"\r\n\ + "TEST003","test003","2022-06-01 09:00:00","1.234567","2022-06-01 09:00:00","0"\r\n\ """ # 返り値の期待値チェック assert isinstance(actual_csv_string, str), 'CSV文字列が返却される' From 5841af2bbed8731147ba293182a871ba7cf47ae4 Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Tue, 23 Aug 2022 11:54:43 +0900 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20salesforce=E3=81=AE=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E5=A4=89=E6=9B=B4=E3=81=AB=E4=BC=B4=E3=81=86?= =?UTF-8?q?=E4=BB=B6=E6=95=B0=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/crm-datafetch/tests/salesforce/test_salesforce.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ecs/crm-datafetch/tests/salesforce/test_salesforce.py b/ecs/crm-datafetch/tests/salesforce/test_salesforce.py index b815e772..4a3667f5 100644 --- a/ecs/crm-datafetch/tests/salesforce/test_salesforce.py +++ b/ecs/crm-datafetch/tests/salesforce/test_salesforce.py @@ -160,7 +160,7 @@ class TestSalesforceApiClient: - LastFetchDatetimeのFromに2000年1月1日を指定する - LastFetchDatetimeのToに2100年12月31日を指定する Expects: - 取得件数が16になる + 取得件数が17になる """ execute_datetime = ExecuteDateTime() @@ -190,7 +190,7 @@ class TestSalesforceApiClient: sut = SalesforceApiClient() actual = sut.fetch_sf_count(soql) - assert actual == 16 + assert actual == 17 def test_fetch_sf_data_one_record(self): """ @@ -433,7 +433,7 @@ class TestSalesforceApiClient: - LastFetchDatetimeのFromに2000年1月1日を指定する - LastFetchDatetimeのToに2100年12月31日を指定する Expects: - 取得できたオブジェクト件数が16件になる + 取得できたオブジェクト件数が17件になる """ execute_datetime = ExecuteDateTime() @@ -463,7 +463,7 @@ class TestSalesforceApiClient: sut = SalesforceApiClient() actual = sut.fetch_sf_data(soql) - assert len(actual) == 16 + assert len(actual) == 17 # 内容の確認は別のケースで行っているため省略 def test_raise_create_instance_cause_auth_failed(self, monkeypatch): From 96b4aac794e5e45983c872612d5465557d38f2f7 Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Wed, 24 Aug 2022 13:24:34 +0900 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E6=8C=87=E6=91=98=E4=BF=AE=E6=AD=A3=20https://nds-tyo.backlog.?= =?UTF-8?q?com/git/NEWDWH2021/newsdwh2021/pullRequests/84#comment-1336807?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/crm-datafetch/tests/converter/test_convert_strategy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecs/crm-datafetch/tests/converter/test_convert_strategy.py b/ecs/crm-datafetch/tests/converter/test_convert_strategy.py index 4b4552a8..bfbe5052 100644 --- a/ecs/crm-datafetch/tests/converter/test_convert_strategy.py +++ b/ecs/crm-datafetch/tests/converter/test_convert_strategy.py @@ -55,7 +55,7 @@ class TestConvertStrategyFactory: # Act sut = ConvertStrategyFactory() - actual = sut.create(1.2345678E7) + actual = sut.create(1.2345678) # Expects # 変換しない From baee5b4142ff1687c6f90aeac106922fa59f003d Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Thu, 25 Aug 2022 11:50:47 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20User=E3=82=AA=E3=83=96=E3=82=B8?= =?UTF-8?q?=E3=82=A7=E3=82=AF=E3=83=88=E3=81=AE=E9=80=A3=E6=90=BA=E5=AF=BE?= =?UTF-8?q?=E8=B1=A1=E5=A4=96=E3=82=AB=E3=83=A9=E3=83=A0=E3=81=8C=E6=AD=A3?= =?UTF-8?q?=E5=BC=8F=E5=AF=BE=E5=BF=9C=E3=81=95=E3=82=8C=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/crm-datafetch/tests/test_walk_through.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/ecs/crm-datafetch/tests/test_walk_through.py b/ecs/crm-datafetch/tests/test_walk_through.py index e8c3b6e4..dabd8a02 100644 --- a/ecs/crm-datafetch/tests/test_walk_through.py +++ b/ecs/crm-datafetch/tests/test_walk_through.py @@ -73,7 +73,6 @@ def test_walk_through(s3_test, s3_client, monkeypatch, caplog): object_info_list = get_object_config_list('object_info') for object_info in object_info_list: json_file = read_json(object_info) - json_file = to_upload_json(json_file) upload_json(json_file, s3_client, CONFIG_BUCKET, f'{OBJECT_INFO_FOLDER}/{path.basename(object_info)}') object_info_files.append(json_file) last_fetch_datetime_list = get_object_config_list('last_fetch_datetime') @@ -295,21 +294,6 @@ def upload_json(json_file, s3_client, bucket, folder): s3_client.put_object(Bucket=bucket, Key=folder, Body=json_str) -def to_upload_json(json_file): - """Userオブジェクトの取得できないプロパティを取り除く - TODO: Userオブジェクトの恒久対応が確定したらこのメソッドは消す - """ - for object_info in json_file['objects']: - if object_info['object_name'] != 'User': - continue - columns: list = object_info['columns'] - columns.remove('LastPasswordChangeDate') - columns.remove('NumberOfFailedLogins') - columns.remove('UserPreferencesNativeEmailClient') - - return json_file - - def set_environment(monkeypatch): # 環境変数を設定(CRMの認証情報は別途設定しておくこと) monkeypatch.setattr('src.aws.s3.IMPORT_DATA_BUCKET', DATA_BUCKET)