diff --git a/src/implementation/v00/configuration_std.py b/src/implementation/v00/configuration_std.py index 46dae16..6b77252 100644 --- a/src/implementation/v00/configuration_std.py +++ b/src/implementation/v00/configuration_std.py @@ -329,6 +329,7 @@ def __init__( assert isinstance(cfgOsOps, ConfigurationOsOps) super().__init__(data_dir, cfgOsOps) + return # -------------------------------------------------------------------- @staticmethod diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/AddOption/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/AddOption/test_set001__common.py index 9e5ae6c..591ec58 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/AddOption/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/AddOption/test_set001__common.py @@ -51,8 +51,10 @@ def test_001__int_opt(self, request: pytest.FixtureRequest, optName: str): __class__.Helper__CheckStateOfCfgWithOneIntOpt(cfg, option, optName, 123) # Amen + return # -------------------------------------------------------------------- + @staticmethod def Helper__CheckStateOfCfgWithOneIntOpt( cfg: PgCfg_Std, opt: PgCfg_Option_Base, optName: str, optValue: int ): @@ -120,6 +122,7 @@ def Helper__CheckStateOfCfgWithOneIntOpt( assert optName in cfg.m_Data.m_AllOptionsByName.keys() assert len(cfg.m_Data.m_AllOptionsByName.values()) == 1 assert opt.m_OptionData in cfg.m_Data.m_AllOptionsByName.values() + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -136,6 +139,7 @@ def test_002__None_value(self, request: pytest.FixtureRequest, optName: str): with pytest.raises(Exception, match=re.escape("None value is not supported.")): cfg.AddOption(optName, None) + return # -------------------------------------------------------------------- def test_003__empty_name(self, request: pytest.FixtureRequest): @@ -150,6 +154,7 @@ def test_003__empty_name(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("Option name is empty.")): cfg.AddOption("", 123) + return # -------------------------------------------------------------------- def test_004__None_name(self, request: pytest.FixtureRequest): @@ -164,6 +169,7 @@ def test_004__None_name(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("Option name is None.")): cfg.AddOption(None, 123) + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -192,6 +198,7 @@ def test_005__already_defined(self, request: pytest.FixtureRequest, optName: str assert option.get_Name() == optName assert option.get_Value() == 123 + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/AddTopLevelFile/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/AddTopLevelFile/test_set001__common.py index 125e086..a9c83ac 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/AddTopLevelFile/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/AddTopLevelFile/test_set001__common.py @@ -50,6 +50,7 @@ def test_001(self, request: pytest.FixtureRequest): cfg.SetOptionValue("port", None) assert len(file1.get_Lines()) == 0 + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/GetOptionValue/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/GetOptionValue/test_set001__common.py index abbd492..fe79c7b 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/GetOptionValue/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/GetOptionValue/test_set001__common.py @@ -39,7 +39,7 @@ def test_001__port(self, request: pytest.FixtureRequest, optName: str): assert type(set_r) is PgCfg_SetOptionResult_Base assert isinstance(set_r, PgCfg_SetOptionResult) assert set_r.m_EventID == PgCfg_SetOptionEventID.OPTION_WAS_ADDED - set_r_option: PgCfg_Option_Base = set_r.Option + set_r_option = set_r.Option assert set_r_option is not None assert type(set_r_option) is PgCfg_Option_Base assert isinstance(set_r_option, PostgresConfigurationOption) @@ -52,6 +52,7 @@ def test_001__port(self, request: pytest.FixtureRequest, optName: str): get_r = cfg.GetOptionValue(optName) assert type(get_r) is int assert get_r == 123 + return # -------------------------------------------------------------------- def test_002__None_name(self, request: pytest.FixtureRequest): @@ -64,6 +65,7 @@ def test_002__None_name(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("Option name is None.")): cfg.GetOptionValue(None) + return # -------------------------------------------------------------------- def test_003__empty_name(self, request: pytest.FixtureRequest): @@ -76,6 +78,7 @@ def test_003__empty_name(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("Option name is empty.")): cfg.GetOptionValue("") + return # -------------------------------------------------------------------- def test_004__opt_with_list__get_None(self, request: pytest.FixtureRequest): @@ -91,6 +94,7 @@ def test_004__opt_with_list__get_None(self, request: pytest.FixtureRequest): v = cfg.GetOptionValue(C_OPT_NAME) assert v is None + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/Mix/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/Mix/test_set001__common.py index a3977e7..dbf685a 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/Mix/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/Mix/test_set001__common.py @@ -27,6 +27,7 @@ def test_001__get_Configuration(self, request: pytest.FixtureRequest): assert cfg.m_Data.m_DataDir == rootTmpDir assert cfg.get_Configuration() is cfg + return # -------------------------------------------------------------------- def test_002__get_Parent(self, request: pytest.FixtureRequest): @@ -40,6 +41,7 @@ def test_002__get_Parent(self, request: pytest.FixtureRequest): assert cfg.m_Data.m_DataDir == rootTmpDir assert cfg.get_Parent() is None + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py index ce8cf9d..77195b7 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValue/test_set001__common.py @@ -53,7 +53,7 @@ def test_001__int_opt(self, request: pytest.FixtureRequest, optName: str): assert type(r) is PgCfg_SetOptionResult_Base assert isinstance(r, PgCfg_SetOptionResult) assert r.m_EventID == PgCfg_SetOptionEventID.OPTION_WAS_ADDED - r_option: PgCfg_Option_Base = r.Option + r_option = r.Option assert r_option is not None assert type(r_option) is PgCfg_Option_Base assert isinstance(r_option, PostgresConfigurationOption) @@ -62,6 +62,7 @@ def test_001__int_opt(self, request: pytest.FixtureRequest, optName: str): __class__.Helper__CheckStateOfCfgWithOneOpt(cfg, r_option, optName, 123) # Amen + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -80,15 +81,17 @@ def test_002__port___reasign(self, request: pytest.FixtureRequest, optName: str) r = cfg.SetOptionValue(optName, 321) assert type(r) is PgCfg_SetOptionResult_Base assert r.m_EventID == PgCfg_SetOptionEventID.OPTION_WAS_UPDATED - r_option: PgCfg_Option_Base = r.Option + r_option = r.Option assert r_option is not None assert type(r_option) is PgCfg_Option_Base assert isinstance(r_option, PostgresConfigurationOption) assert r.Option is r_option # check a cache __class__.Helper__CheckStateOfCfgWithOneOpt(cfg, r_option, optName, 321) + return # -------------------------------------------------------------------- + @staticmethod def Helper__CheckStateOfCfgWithOneOpt( cfg: PgCfg_Std, opt: PgCfg_Option_Base, optName: str, optValue: typing.Any ): @@ -156,6 +159,7 @@ def Helper__CheckStateOfCfgWithOneOpt( assert optName in cfg.m_Data.m_AllOptionsByName.keys() assert len(cfg.m_Data.m_AllOptionsByName.values()) == 1 assert opt.m_OptionData in cfg.m_Data.m_AllOptionsByName.values() + return # -------------------------------------------------------------------- def test_003__port___bad_type(self, request: pytest.FixtureRequest): @@ -173,6 +177,7 @@ def test_003__port___bad_type(self, request: pytest.FixtureRequest): ), ): cfg.SetOptionValue("port", True) + return # -------------------------------------------------------------------- def test_004__port___cont_convert_value(self, request: pytest.FixtureRequest): @@ -190,6 +195,7 @@ def test_004__port___cont_convert_value(self, request: pytest.FixtureRequest): ), ): cfg.SetOptionValue("port", "123.") + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -207,12 +213,14 @@ def test_006(self, request: pytest.FixtureRequest, optName: str): r1 = cfg.SetOptionValue(optName, 123) assert type(r1) is PgCfg_SetOptionResult_Base assert r1.m_EventID == PgCfg_SetOptionEventID.OPTION_WAS_ADDED + assert r1.Option is not None assert r1.Option.get_Name() == optName assert r1.Option.get_Value() == 123 r2 = cfg.SetOptionValue(optName, 321) assert type(r2) is PgCfg_SetOptionResult_Base assert r2.m_EventID == PgCfg_SetOptionEventID.OPTION_WAS_UPDATED + assert r2.Option is not None assert r2.Option.get_Name() == optName assert r2.Option.get_Value() == 321 @@ -223,11 +231,13 @@ def test_006(self, request: pytest.FixtureRequest, optName: str): assert type(r3) is PgCfg_SetOptionResult_Base assert r3.m_EventID == PgCfg_SetOptionEventID.OPTION_WAS_UPDATED assert r3.Option is r1.Option + assert r3.Option is not None assert r3.Option.get_Name() == optName assert r3.Option.get_Value() == 555 assert r1.Option.get_Value() == 555 assert r2.Option.get_Value() == 555 + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -249,6 +259,7 @@ def test_007__set_None(self, request: pytest.FixtureRequest, optName: str): assert r.m_Opt is None assert r.m_OptData is None assert r.Option is None + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -318,6 +329,7 @@ def test_008__set_Int_set_None(self, request: pytest.FixtureRequest, optName: st assert r3.m_Opt is None assert r3.m_OptData is None assert r3.Option is None + return # -------------------------------------------------------------------- def test_009__spec_file(self, request: pytest.FixtureRequest): @@ -354,6 +366,7 @@ def test_009__spec_file(self, request: pytest.FixtureRequest): assert type(rs1.m_OptData) is PgCfgModel__OptionData assert rs1.m_OptData.m_Value == optValue assert rs1.m_OptData.m_Name == C_OPT_NAME + assert rs1.Option is not None assert rs1.Option.get_Name() == C_OPT_NAME assert rs1.Option.get_Value() == optValue assert rs1.Option.get_Configuration() is cfg @@ -380,6 +393,8 @@ def test_009__spec_file(self, request: pytest.FixtureRequest): cfg.SetOptionValue(C_OPT_NAME, None) assert len(file1.get_Lines()) == 0 + continue + return # -------------------------------------------------------------------- def test_010__None_name(self, request: pytest.FixtureRequest): @@ -392,6 +407,7 @@ def test_010__None_name(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("Option name is None.")): cfg.SetOptionValue(None, 123) + return # -------------------------------------------------------------------- def test_011__empty_name(self, request: pytest.FixtureRequest): @@ -404,6 +420,7 @@ def test_011__empty_name(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("Option name is empty.")): cfg.SetOptionValue("", 123) + return # -------------------------------------------------------------------- sm_data012__values: typing.List[typing.Tuple[str, str, typing.Any, typing.Any]] = [ @@ -443,7 +460,7 @@ def test_012__one_opt( assert type(r) is PgCfg_SetOptionResult_Base assert isinstance(r, PgCfg_SetOptionResult) assert r.m_EventID == PgCfg_SetOptionEventID.OPTION_WAS_ADDED - r_option: PgCfg_Option_Base = r.Option + r_option = r.Option assert r_option is not None assert type(r_option) is PgCfg_Option_Base assert isinstance(r_option, PostgresConfigurationOption) @@ -452,6 +469,7 @@ def test_012__one_opt( __class__.Helper__CheckStateOfCfgWithOneOpt( cfg, r_option, data012[0], data012[2] ) + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValueItem/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValueItem/test_set001__common.py index 9004263..b978fd4 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValueItem/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/SetOptionValueItem/test_set001__common.py @@ -65,6 +65,8 @@ def test_001(self, request: pytest.FixtureRequest): assert r1.Option.get_Value() == ["biha"] assert cfg.GetOptionValue(C_OPT_NAME) == ["biha"] + continue + return # -------------------------------------------------------------------- def test_002(self, request: pytest.FixtureRequest): @@ -124,6 +126,7 @@ def test_002(self, request: pytest.FixtureRequest): assert r1.m_OptData.m_Value[i] is not None assert type(r1.m_OptData.m_Value[i]) is str assert r1.m_OptData.m_Value[i] == expectedValue[i] + continue assert r1.m_OptData.m_Value == expectedValue @@ -134,6 +137,8 @@ def test_002(self, request: pytest.FixtureRequest): assert r1.Option.get_Value() == expectedValue assert cfg.GetOptionValue(C_OPT_NAME) == expectedValue + continue + return # -------------------------------------------------------------------- def test_003(self, request: pytest.FixtureRequest): @@ -152,7 +157,9 @@ def test_003(self, request: pytest.FixtureRequest): assert r1.m_OptData is r2.m_OptData + assert r1.Option is not None assert r1.Option.get_Value() == ["biha", "proxima"] + return # -------------------------------------------------------------------- def test_004__check_get_prepare_filter__unique( @@ -169,13 +176,16 @@ def test_004__check_get_prepare_filter__unique( r1 = cfg.SetOptionValueItem(C_OPT_NAME, "biha") + assert r1.m_OptData is not None assert r1.m_OptData.m_Value == ["biha"] + assert r1.Option is not None assert r1.Option.get_Value() == ["biha"] r1.m_OptData.m_Value.append("biha") assert r1.m_OptData.m_Value == ["biha", "biha"] assert r1.Option.get_Value() == ["biha"] + return # -------------------------------------------------------------------- def test_005__check_get_prepare_filter__to_str( @@ -192,7 +202,9 @@ def test_005__check_get_prepare_filter__to_str( r1 = cfg.SetOptionValueItem(C_OPT_NAME, "biha") + assert r1.m_OptData is not None assert r1.m_OptData.m_Value == ["biha"] + assert r1.Option is not None assert r1.Option.get_Value() == ["biha"] r1.m_OptData.m_Value.append(1) @@ -201,6 +213,7 @@ def test_005__check_get_prepare_filter__to_str( assert r1.m_OptData.m_Value != ["biha", "1"] assert r1.Option.get_Value() == ["biha", "1"] assert r1.Option.get_Value() != ["biha", 1] + return # -------------------------------------------------------------------- def test_006__set_value_item_with_bad_type(self, request: pytest.FixtureRequest): @@ -215,7 +228,9 @@ def test_006__set_value_item_with_bad_type(self, request: pytest.FixtureRequest) r1 = cfg.SetOptionValueItem(C_OPT_NAME, "biha") + assert r1.m_OptData is not None assert r1.m_OptData.m_Value == ["biha"] + assert r1.Option is not None assert r1.Option.get_Value() == ["biha"] errMsg = ( @@ -229,6 +244,7 @@ def test_006__set_value_item_with_bad_type(self, request: pytest.FixtureRequest) assert r1.m_OptData.m_Value == ["biha"] assert r1.Option.get_Value() == ["biha"] + return # -------------------------------------------------------------------- def test_007__set_None(self, request: pytest.FixtureRequest): @@ -243,7 +259,9 @@ def test_007__set_None(self, request: pytest.FixtureRequest): r1 = cfg.SetOptionValueItem(C_OPT_NAME, "biha") + assert r1.m_OptData is not None assert r1.m_OptData.m_Value == ["biha"] + assert r1.Option is not None assert r1.Option.get_Value() == ["biha"] errMsg = "None value is not supported." @@ -253,6 +271,7 @@ def test_007__set_None(self, request: pytest.FixtureRequest): assert r1.m_OptData.m_Value == ["biha"] assert r1.Option.get_Value() == ["biha"] + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/get_AllFiles/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/get_AllFiles/test_set001__common.py index cde4fd3..362ddfc 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/get_AllFiles/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/get_AllFiles/test_set001__common.py @@ -39,6 +39,7 @@ def test_000(self, request: pytest.FixtureRequest): allFiles2 = cfg.get_AllFiles() assert allFiles2 is allFiles1 # check cache + return # -------------------------------------------------------------------- sm_OPTS001: typing.List[str] = ["port", "proxima.port"] @@ -73,6 +74,7 @@ def test_001(self, request: pytest.FixtureRequest, optName: str): assert allFiles1_list[0].get_Path() == os.path.join( rootTmpDir, "postgresql.auto.conf" ) + return # -------------------------------------------------------------------- def test_002__iter(self, request: pytest.FixtureRequest): @@ -102,6 +104,7 @@ def test_002__iter(self, request: pytest.FixtureRequest): # NOTE: it may change in the future assert it1a.m_FileDataIterator is it1.m_FileDataIterator assert it1a is it1 + return # -------------------------------------------------------------------- def test_003__transform_to_list(self, request: pytest.FixtureRequest): @@ -119,6 +122,7 @@ def test_003__transform_to_list(self, request: pytest.FixtureRequest): cfg.SetOptionValue("port", 333) v = list(allFiles1) assert len(v) == 1 + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/get_AllOptions/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/get_AllOptions/test_set001__common.py index 0fee721..9097f00 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/get_AllOptions/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration/get_AllOptions/test_set001__common.py @@ -39,6 +39,7 @@ def test_000(self, request: pytest.FixtureRequest): allOptions2 = cfg.get_AllOptions() assert allOptions2 is allOptions1 # check cache + return # -------------------------------------------------------------------- sm_OPTS001: typing.List[str] = ["port", "proxima.port"] @@ -67,6 +68,7 @@ def test_001(self, request: pytest.FixtureRequest, optName: str): assert type(option) is PgCfg_Option_Base assert isinstance(option, PgCfg_Option) allOptions1_list.append(option) + continue assert allOptions1_list is not None assert len(allOptions1_list) == 1 @@ -75,6 +77,7 @@ def test_001(self, request: pytest.FixtureRequest, optName: str): assert allOptions1_list[0].get_Value() == 123 assert allOptions1_list[0].get_Parent().get_Parent().get_Parent() == cfg + return # -------------------------------------------------------------------- def test_002__iter(self, request: pytest.FixtureRequest): @@ -104,6 +107,7 @@ def test_002__iter(self, request: pytest.FixtureRequest): # NOTE: it may change in the future assert it1a.m_OptionDataIterator is it1.m_OptionDataIterator assert it1a is it1 + return # -------------------------------------------------------------------- def test_003__transform_to_list(self, request: pytest.FixtureRequest): @@ -121,6 +125,7 @@ def test_003__transform_to_list(self, request: pytest.FixtureRequest): cfg.SetOptionValue("port", 333) v = list(allOptions1) assert len(v) == 1 + return # -------------------------------------------------------------------- def test_004__two_options(self, request: pytest.FixtureRequest): @@ -147,6 +152,8 @@ def test_004__two_options(self, request: pytest.FixtureRequest): assert opt.get_Name() not in names names.add(opt.get_Name()) + continue + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationComment/Delete/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationComment/Delete/test_set001__common.py index f4096c1..78ed128 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationComment/Delete/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationComment/Delete/test_set001__common.py @@ -58,6 +58,7 @@ def test_001__withLine(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("FileLine object was deleted.")): len(fileLine) + return # -------------------------------------------------------------------- def test_002__withoutLine(self, request: pytest.FixtureRequest): @@ -99,6 +100,7 @@ def test_002__withoutLine(self, request: pytest.FixtureRequest): assert fileLine.get_Parent() is file assert len(fileLine) == 0 + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationFileLine/AddComment/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationFileLine/AddComment/test_set001__common.py index 50243ac..654109b 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationFileLine/AddComment/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationFileLine/AddComment/test_set001__common.py @@ -67,6 +67,7 @@ def test_001(self, request: pytest.FixtureRequest, offset001: typing.Optional[in assert comment.get_Configuration() is cfg assert comment.get_Parent() is fileLine assert comment.get_Text() == "comment" + return # -------------------------------------------------------------------- def test_E01__second_comment_in_line(self, request: pytest.FixtureRequest): @@ -103,6 +104,7 @@ def test_E01__second_comment_in_line(self, request: pytest.FixtureRequest): assert comment.get_Configuration() is cfg assert comment.get_Parent() is fileLine assert comment.get_Text() == "comment" + return # -------------------------------------------------------------------- def test_E02__bad_symbol(self, request: pytest.FixtureRequest): @@ -121,6 +123,7 @@ def test_E02__bad_symbol(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match="Comment text contains invalid symbols."): fileLine.AddComment("\0", 4) + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationFileLine/AddInclude/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationFileLine/AddInclude/test_set001__common.py index db2b28b..fed3125 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationFileLine/AddInclude/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationFileLine/AddInclude/test_set001__common.py @@ -80,6 +80,7 @@ def test_001(self, request: pytest.FixtureRequest, offset001: typing.Optional[in # assert include.get_File() is includedFile assert includedFile.get_Path() == os.path.join(rootTmpDir, C_FILE_NAME) assert includedFile.get_Parent() is include + return # -------------------------------------------------------------------- def test_E01__after_option(self, request: pytest.FixtureRequest): @@ -120,6 +121,7 @@ def test_E01__after_option(self, request: pytest.FixtureRequest): assert option.get_Parent().m_FileLineData is fileLine.m_FileLineData assert option.get_Name() == "port" assert option.get_Value() == 123 + return # -------------------------------------------------------------------- def test_E02__after_include(self, request: pytest.FixtureRequest): @@ -146,6 +148,7 @@ def test_E02__after_include(self, request: pytest.FixtureRequest): assert len(fileLine) == 1 assert fileLine.m_FileLineData.m_Items[0].m_Element is include.m_IncludeData + return # -------------------------------------------------------------------- def test_E03__after_comment(self, request: pytest.FixtureRequest): @@ -172,6 +175,7 @@ def test_E03__after_comment(self, request: pytest.FixtureRequest): assert len(fileLine) == 1 assert fileLine.m_FileLineData.m_Items[0].m_Element is comment.m_CommentData + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationInclude/Delete/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationInclude/Delete/test_set001__common.py index 5ee1223..afcb611 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationInclude/Delete/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationInclude/Delete/test_set001__common.py @@ -59,6 +59,7 @@ def test_001__withLine(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("FileLine object was deleted.")): len(fileLine) + return # -------------------------------------------------------------------- def test_002__withoutLine(self, request: pytest.FixtureRequest): @@ -102,6 +103,7 @@ def test_002__withoutLine(self, request: pytest.FixtureRequest): assert fileLine.get_Parent() is file assert len(fileLine) == 0 + return # -------------------------------------------------------------------- @@ -159,6 +161,7 @@ def test_003__line_with_comment__delete_withLine( with pytest.raises(Exception, match=re.escape("FileLine object was deleted.")): len(fileLine) + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationOption/Mix/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationOption/Mix/test_set001__common.py index ee721b6..69f3a95 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationOption/Mix/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationOption/Mix/test_set001__common.py @@ -44,6 +44,7 @@ def test_001(self, request: pytest.FixtureRequest, optName: str): assert type(r1.Option.get_Parent()) is PgCfg_FileLine_Base assert type(r1.Option.get_Parent().get_Parent()) is PgCfg_TopLevelFile_Base assert r1.Option.get_Parent().get_Parent().get_Parent() is cfg + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -82,6 +83,7 @@ def test_002__set_Value__int(self, request: pytest.FixtureRequest, optName: str) assert type(r1.Option.get_Parent()) is PgCfg_FileLine_Base assert type(r1.Option.get_Parent().get_Parent()) is PgCfg_TopLevelFile_Base assert r1.Option.get_Parent().get_Parent().get_Parent() is cfg + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -124,6 +126,7 @@ def test_003__set_Value__None(self, request: pytest.FixtureRequest, optName: str with pytest.raises(Exception, match=re.escape("Option object was deleted.")): r1.Option.get_Parent() + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -164,6 +167,8 @@ def test_004__set_Value__invalid( assert r1.Option.get_Name() == optName assert r1.Option.get_Value() == 234 + continue + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -204,6 +209,8 @@ def test_005__set_Value__cant_convert_value( assert r1.Option.get_Name() == optName assert r1.Option.get_Value() == 234 + continue + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationOption/set_ValueItem/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationOption/set_ValueItem/test_set001__common.py index 110138b..afc24c3 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationOption/set_ValueItem/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationOption/set_ValueItem/test_set001__common.py @@ -37,6 +37,7 @@ def test_001(self, request: pytest.FixtureRequest): r1 = cfg.SetOptionValueItem(C_OPT_NAME, "biha") assert type(r1) is PgCfg_SetOptionResult_Base + assert r1.Option is not None assert r1.Option.get_Name() == C_OPT_NAME assert r1.Option.get_Value() == ["biha"] assert type(r1.Option.get_Parent()) is PgCfg_FileLine_Base @@ -68,7 +69,10 @@ def test_001(self, request: pytest.FixtureRequest): assert r2.m_OptData.m_Value[0] == "biha" assert r2.m_OptData.m_Value[1] == "proxima" assert r2.m_OptData.m_Value == ["biha", "proxima"] + assert r2.Option is not None assert r2.Option.get_Value() == ["biha", "proxima"] + continue + return # -------------------------------------------------------------------- def test_002__set_None(self, request: pytest.FixtureRequest): @@ -85,6 +89,7 @@ def test_002__set_None(self, request: pytest.FixtureRequest): r1 = cfg.SetOptionValueItem(C_OPT_NAME, "biha") assert type(r1) is PgCfg_SetOptionResult_Base + assert r1.Option is not None assert r1.Option.get_Name() == C_OPT_NAME assert r1.Option.get_Value() == ["biha"] assert type(r1.Option.get_Parent()) is PgCfg_FileLine_Base @@ -95,6 +100,7 @@ def test_002__set_None(self, request: pytest.FixtureRequest): r1.Option.set_ValueItem(None) assert r1.Option.get_Value() == ["biha"] + return # -------------------------------------------------------------------- def test_003__set_value_item_with_bad_type(self, request: pytest.FixtureRequest): @@ -111,6 +117,7 @@ def test_003__set_value_item_with_bad_type(self, request: pytest.FixtureRequest) r1 = cfg.SetOptionValueItem(C_OPT_NAME, "biha") assert type(r1) is PgCfg_SetOptionResult_Base + assert r1.Option is not None assert r1.Option.get_Name() == C_OPT_NAME assert r1.Option.get_Value() == ["biha"] assert type(r1.Option.get_Parent()) is PgCfg_FileLine_Base @@ -126,6 +133,7 @@ def test_003__set_value_item_with_bad_type(self, request: pytest.FixtureRequest) r1.Option.set_ValueItem(1) assert r1.Option.get_Value() == ["biha"] + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationReader_Base/LoadConfigurationFile/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationReader_Base/LoadConfigurationFile/test_set001__common.py index 193090e..780fa18 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationReader_Base/LoadConfigurationFile/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationReader_Base/LoadConfigurationFile/test_set001__common.py @@ -63,6 +63,7 @@ def test_000__empty(self, request: pytest.FixtureRequest): assert file.m_FileData.m_Status == PgCfgModel__FileStatus.EXISTS assert file.m_FileData.m_LastModifiedTimestamp == lastMDate assert len(file.m_FileData.m_Lines) == 0 + return # -------------------------------------------------------------------- def test_001__comment_and_options(self, request: pytest.FixtureRequest): @@ -148,6 +149,7 @@ def test_001__comment_and_options(self, request: pytest.FixtureRequest): assert type(fileDataLines[3].m_Items[1].m_Element) is PgCfgModel__CommentData assert fileDataLines[3].m_Items[1].m_Element.m_Text == "addresses" assert fileDataLines[3].m_Items[1].m_Element.m_Offset == 21 + return # -------------------------------------------------------------------- def test_002__two_files(self, request: pytest.FixtureRequest): @@ -210,6 +212,7 @@ def test_002__two_files(self, request: pytest.FixtureRequest): assert file1.GetOptionValue("port") is None assert file2.GetOptionValue("port") == 123 + return # -------------------------------------------------------------------- def test_003__two_files__duplication_and_cycles( @@ -277,6 +280,7 @@ def test_003__two_files__duplication_and_cycles( assert file1.GetOptionValue("port") is None assert file2.GetOptionValue("port") == 123 + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationReader_Base/LoadFileDataContent/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationReader_Base/LoadFileDataContent/test_set001__common.py index a699b3c..74a9182 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationReader_Base/LoadFileDataContent/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationReader_Base/LoadFileDataContent/test_set001__common.py @@ -59,6 +59,7 @@ def test_001__empty(self, request: pytest.FixtureRequest): assert file1.m_FileData.m_Lines is not None assert type(file1.m_FileData.m_Lines) is list assert len(file1.m_FileData.m_Lines) == 0 + return # -------------------------------------------------------------------- def test_002__space(self, request: pytest.FixtureRequest): @@ -78,6 +79,7 @@ def test_002__space(self, request: pytest.FixtureRequest): assert len(file1) == 1 assert len(file1.m_FileData.m_Lines) == 1 assert len(file1.m_FileData.m_Lines[0].m_Items) == 0 + return # -------------------------------------------------------------------- def test_003__empty_line_with_eol(self, request: pytest.FixtureRequest): @@ -97,6 +99,7 @@ def test_003__empty_line_with_eol(self, request: pytest.FixtureRequest): assert len(file1) == 1 assert len(file1.m_FileData.m_Lines) == 1 assert len(file1.m_FileData.m_Lines[0].m_Items) == 0 + return # -------------------------------------------------------------------- def test_101__comment(self, request: pytest.FixtureRequest): @@ -121,6 +124,7 @@ def test_101__comment(self, request: pytest.FixtureRequest): assert type(fileLineData0.m_Items[0].m_Element) is PgCfgModel__CommentData assert fileLineData0.m_Items[0].m_Element.m_Offset == 1 assert fileLineData0.m_Items[0].m_Element.m_Text == " comment " + return # -------------------------------------------------------------------- def test_102__two_comments(self, request: pytest.FixtureRequest): @@ -151,6 +155,7 @@ def test_102__two_comments(self, request: pytest.FixtureRequest): assert type(fileLineData1.m_Items[0].m_Element) is PgCfgModel__CommentData assert fileLineData1.m_Items[0].m_Element.m_Offset == 4 assert fileLineData1.m_Items[0].m_Element.m_Text == "comment2" + return # -------------------------------------------------------------------- sm_data201__assign: typing.List[typing.Tuple[str, str]] = [ @@ -199,6 +204,7 @@ def test_201__option(self, request: pytest.FixtureRequest, data201__assign: str) assert fileLineData0.m_Items[0].m_Element.m_Offset == 0 assert fileLineData0.m_Items[0].m_Element.m_Name == "port" assert fileLineData0.m_Items[0].m_Element.m_Value == 123 + return # -------------------------------------------------------------------- def test_202__option(self, request: pytest.FixtureRequest): @@ -224,6 +230,7 @@ def test_202__option(self, request: pytest.FixtureRequest): assert fileLineData0.m_Items[0].m_Element.m_Offset == 0 assert fileLineData0.m_Items[0].m_Element.m_Name == "port" assert fileLineData0.m_Items[0].m_Element.m_Value == 234 + return # -------------------------------------------------------------------- def test_203__option__without_assign(self, request: pytest.FixtureRequest): @@ -249,6 +256,7 @@ def test_203__option__without_assign(self, request: pytest.FixtureRequest): assert fileLineData0.m_Items[0].m_Element.m_Offset == 0 assert fileLineData0.m_Items[0].m_Element.m_Name == "port" assert fileLineData0.m_Items[0].m_Element.m_Value == 234 + return # -------------------------------------------------------------------- sm_data204: typing.List[typing.Tuple[str, str]] = [ @@ -297,6 +305,7 @@ def test_204__option_without_value( Exception, match=re.escape("Option [port] in line 1 does not have a value.") ): PgCfg_Reader_Base.LoadFileContent(file1, src) + return # -------------------------------------------------------------------- def test_211__option_with_comment(self, request: pytest.FixtureRequest): @@ -326,6 +335,7 @@ def test_211__option_with_comment(self, request: pytest.FixtureRequest): assert type(fileLineData0.m_Items[1].m_Element) is PgCfgModel__CommentData assert fileLineData0.m_Items[1].m_Element.m_Offset == 9 assert fileLineData0.m_Items[1].m_Element.m_Text == "comment" + return # -------------------------------------------------------------------- def test_212__option_with_comment_immediate(self, request: pytest.FixtureRequest): @@ -355,6 +365,7 @@ def test_212__option_with_comment_immediate(self, request: pytest.FixtureRequest assert type(fileLineData0.m_Items[1].m_Element) is PgCfgModel__CommentData assert fileLineData0.m_Items[1].m_Element.m_Offset == 8 assert fileLineData0.m_Items[1].m_Element.m_Text == "comment " + return # -------------------------------------------------------------------- def test_301__optionQ(self, request: pytest.FixtureRequest): @@ -380,6 +391,7 @@ def test_301__optionQ(self, request: pytest.FixtureRequest): assert fileLineData0.m_Items[0].m_Element.m_Offset == 0 assert fileLineData0.m_Items[0].m_Element.m_Name == "port" assert fileLineData0.m_Items[0].m_Element.m_Value == 123 + return # -------------------------------------------------------------------- def test_302__optionQ__empty( @@ -408,6 +420,7 @@ def test_302__optionQ__empty( assert fileLineData0.m_Items[0].m_Element.m_Offset == 0 assert fileLineData0.m_Items[0].m_Element.m_Name == "listen_addresses" assert fileLineData0.m_Items[0].m_Element.m_Value == "" + return # -------------------------------------------------------------------- def test_303__optionQ__two_quote(self, request: pytest.FixtureRequest): @@ -433,6 +446,7 @@ def test_303__optionQ__two_quote(self, request: pytest.FixtureRequest): assert fileLineData0.m_Items[0].m_Element.m_Offset == 0 assert fileLineData0.m_Items[0].m_Element.m_Name == "listen_addresses" assert fileLineData0.m_Items[0].m_Element.m_Value == "'" + return # -------------------------------------------------------------------- sm_endData304: typing.List[typing.Tuple[str, str, str]] = [ @@ -484,6 +498,7 @@ def test_304__optionQ__escape( assert fileLineData0.m_Items[0].m_Element.m_Offset == 0 assert fileLineData0.m_Items[0].m_Element.m_Name == "listen_addresses" assert fileLineData0.m_Items[0].m_Element.m_Value == endData304[2] + return # -------------------------------------------------------------------- sm_data3E01: typing.List[typing.Tuple[str, str]] = [ @@ -526,6 +541,7 @@ def test_3E01__optionQ__no_end_quote( ), ): PgCfg_Reader_Base.LoadFileContent(file1, src) + return # -------------------------------------------------------------------- sm_data3E02: typing.List[typing.Tuple[str, str]] = [ @@ -564,6 +580,7 @@ def test_3E02__optionQ__incompleted_escape( ), ): PgCfg_Reader_Base.LoadFileContent(file1, src) + return # -------------------------------------------------------------------- def test_3E03__optionQ__unk_escaped_symbol(self, request: pytest.FixtureRequest): @@ -585,6 +602,7 @@ def test_3E03__optionQ__unk_escaped_symbol(self, request: pytest.FixtureRequest) ), ): PgCfg_Reader_Base.LoadFileContent(file1, src) + return # -------------------------------------------------------------------- def test_401__include(self, request: pytest.FixtureRequest): @@ -612,6 +630,7 @@ def test_401__include(self, request: pytest.FixtureRequest): file_A = cfg.get_AllFiles().GetFileByName("a.conf") assert file_A.get_Path() == os.path.join(rootTmpDir, "a.conf") + return # -------------------------------------------------------------------- def test_4E01__empty_path(self, request: pytest.FixtureRequest): @@ -630,6 +649,7 @@ def test_4E01__empty_path(self, request: pytest.FixtureRequest): Exception, match=re.escape("Include in line 1 has an empty path.") ): PgCfg_Reader_Base.LoadFileContent(file1, src) + return # -------------------------------------------------------------------- sm_dataE4E02: typing.List[typing.Tuple[str, str]] = [ @@ -663,6 +683,7 @@ def test_4E02__incompleted_path( match=re.escape("The end of an include path is not found. Line 1."), ): PgCfg_Reader_Base.LoadFileContent(file1, src) + return # -------------------------------------------------------------------- def test_4E03__unknown_escape_symbol(self, request: pytest.FixtureRequest): @@ -715,6 +736,7 @@ def test_4E04__incompleted_escape( match=re.escape("Escape in an include path is not completed. Line 1."), ): PgCfg_Reader_Base.LoadFileContent(file1, src) + return # -------------------------------------------------------------------- sm_dataE4E05: typing.List[typing.Tuple[str, str]] = [ @@ -758,6 +780,7 @@ def test_4E05__include_without_path( match=re.escape("Include directive in line 1 does not have a path."), ): PgCfg_Reader_Base.LoadFileContent(file1, src) + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddComment/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddComment/test_set001__common.py index ab00127..b7df00b 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddComment/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddComment/test_set001__common.py @@ -92,6 +92,7 @@ def test_001(self, request: pytest.FixtureRequest): assert comment2.get_Text() == "HELLO!" assert cfg.GetOptionValue("port") == 123 + return # -------------------------------------------------------------------- def test_002(self, request: pytest.FixtureRequest): @@ -141,6 +142,8 @@ def test_002(self, request: pytest.FixtureRequest): assert comment1.get_Text() == "1" assert comment2.get_Text() == "" + continue + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddEmptyLine/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddEmptyLine/test_set001__common.py index 994392f..10e9b8d 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddEmptyLine/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddEmptyLine/test_set001__common.py @@ -58,6 +58,7 @@ def test_001(self, request: pytest.FixtureRequest): assert len(fileLine2.m_FileLineData.m_Items) == 0 assert cfg.GetOptionValue("port") == 123 + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddInclude/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddInclude/test_set001__common.py index c66df52..45e79cd 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddInclude/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddInclude/test_set001__common.py @@ -108,6 +108,7 @@ def test_001(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match="Include object was deleted."): bihaConfFileInclude.get_File() + return # -------------------------------------------------------------------- def test_002__include_twice(self, request: pytest.FixtureRequest): @@ -145,6 +146,7 @@ def test_002__include_twice(self, request: pytest.FixtureRequest): assert bihaConfFile2.get_Path() == os.path.join( rootTmpDir, C_BIHA_CONF_FILE_NAME ) + return # -------------------------------------------------------------------- def test_003__empty_file_path(self, request: pytest.FixtureRequest): @@ -161,6 +163,7 @@ def test_003__empty_file_path(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("File path is empty.")): file1.AddInclude("") + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddOption/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddOption/test_set001__common.py index 37e65c9..be7e659 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddOption/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/AddOption/test_set001__common.py @@ -60,6 +60,7 @@ def test_001(self, request: pytest.FixtureRequest): assert C_OPT_NAME in cfg.m_Data.m_AllOptionsByName.keys() assert cfg.m_Data.m_AllOptionsByName[C_OPT_NAME] is option.m_OptionData + return # -------------------------------------------------------------------- def test_002__already_in_this(self, request: pytest.FixtureRequest): @@ -93,6 +94,7 @@ def test_002__already_in_this(self, request: pytest.FixtureRequest): assert C_OPT_NAME in cfg.m_Data.m_AllOptionsByName.keys() assert cfg.m_Data.m_AllOptionsByName[C_OPT_NAME] is option.m_OptionData + return # -------------------------------------------------------------------- def test_003__already_in_another(self, request: pytest.FixtureRequest): @@ -130,6 +132,7 @@ def test_003__already_in_another(self, request: pytest.FixtureRequest): assert C_OPT_NAME in cfg.m_Data.m_AllOptionsByName.keys() assert cfg.m_Data.m_AllOptionsByName[C_OPT_NAME] is option.m_OptionData + return # -------------------------------------------------------------------- def test_004__bad_value_type(self, request: pytest.FixtureRequest): @@ -153,6 +156,7 @@ def test_004__bad_value_type(self, request: pytest.FixtureRequest): ), ): file.AddOption(C_OPT_NAME, False) + return # -------------------------------------------------------------------- def test_004__cant_convert_value(self, request: pytest.FixtureRequest): @@ -176,6 +180,7 @@ def test_004__cant_convert_value(self, request: pytest.FixtureRequest): ), ): file.AddOption(C_OPT_NAME, "blabla") + return # -------------------------------------------------------------------- def test_005__None_value(self, request: pytest.FixtureRequest): @@ -195,6 +200,7 @@ def test_005__None_value(self, request: pytest.FixtureRequest): match=re.escape("None value is not supported."), ): file.AddOption(C_OPT_NAME, None) + return # -------------------------------------------------------------------- def test_006__None_name(self, request: pytest.FixtureRequest): @@ -212,6 +218,7 @@ def test_006__None_name(self, request: pytest.FixtureRequest): match=re.escape("Option name is None."), ): file.AddOption(None, 123) + return # -------------------------------------------------------------------- def test_007__empty_name(self, request: pytest.FixtureRequest): @@ -229,6 +236,7 @@ def test_007__empty_name(self, request: pytest.FixtureRequest): match=re.escape("Option name is empty."), ): file.AddOption("", 123) + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/GetOptionValue/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/GetOptionValue/test_set001__common.py index 38c4a0a..a0a8fdf 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/GetOptionValue/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/GetOptionValue/test_set001__common.py @@ -31,6 +31,7 @@ def test_001__no_opt(self, request: pytest.FixtureRequest, optName: str): file = cfg.AddTopLevelFile(cfg.C_POSTGRESQL_CONF) assert file.GetOptionValue(optName) is None + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -55,6 +56,7 @@ def test_002(self, request: pytest.FixtureRequest, optName: str): option.set_Value(321) assert file.GetOptionValue(optName) == 321 + return # -------------------------------------------------------------------- def test_003__opt_with_list__get_None(self, request: pytest.FixtureRequest): @@ -72,6 +74,7 @@ def test_003__opt_with_list__get_None(self, request: pytest.FixtureRequest): v = file.GetOptionValue(C_OPT_NAME) assert v is None + return # -------------------------------------------------------------------- def test_004__opt_with_list__with_data(self, request: pytest.FixtureRequest): @@ -96,6 +99,8 @@ def test_004__opt_with_list__with_data(self, request: pytest.FixtureRequest): assert v == ["xxx"] v.append("yyy") + continue + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/SetOptionValue/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/SetOptionValue/test_set001__common.py index 6bc8745..6633ec2 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/SetOptionValue/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/SetOptionValue/test_set001__common.py @@ -132,6 +132,7 @@ def test_001(self, request: pytest.FixtureRequest, optName: str): assert option.m_OptionData.m_Value == 321 assert option.get_Name() == optName assert option.get_Value() == 321 + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -176,6 +177,7 @@ def test_002__set_None(self, request: pytest.FixtureRequest, optName: str): assert set_r3.m_OptData is None assert cfg.GetOptionValue(optName) is None + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -215,6 +217,7 @@ def test_003__already_exist(self, request: pytest.FixtureRequest, optName: str): assert len(file1.get_Lines()) == 1 assert len(file2.get_Lines()) == 0 + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -247,6 +250,8 @@ def test_004__set_value_with_bad_type( assert len(cfg.m_Data.m_AllOptionsByName) == 0 assert len(file1.m_FileData.m_OptionsByName) == 0 + continue + return # -------------------------------------------------------------------- @pytest.mark.parametrize("optName", sm_OPTS001, ids=lambda x: f"{x}") @@ -277,6 +282,8 @@ def test_005__cant_convert_value( assert len(cfg.m_Data.m_AllOptionsByName) == 0 assert len(file1.m_FileData.m_OptionsByName) == 0 + continue + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/SetOptionValueItem/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/SetOptionValueItem/test_set001__common.py index f2d1a4c..9d9b767 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/SetOptionValueItem/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/SetOptionValueItem/test_set001__common.py @@ -36,6 +36,7 @@ def test_001__set_None(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape("None value is not supported.")): file.SetOptionValueItem(C_OPT_NAME, None) + return # -------------------------------------------------------------------- def test_002__set_value_item_with_bad_type(self, request: pytest.FixtureRequest): @@ -58,6 +59,7 @@ def test_002__set_value_item_with_bad_type(self, request: pytest.FixtureRequest) ) with pytest.raises(Exception, match=re.escape(errMsg)): file.SetOptionValueItem(C_OPT_NAME, 123) + return # -------------------------------------------------------------------- def test_003(self, request: pytest.FixtureRequest): @@ -100,6 +102,7 @@ def test_003(self, request: pytest.FixtureRequest): assert r1.m_OptData.m_Value == ["biha"] assert r1.Option is r1.m_Opt # check cache + assert r1.Option is not None assert r1.Option.get_Value() == ["biha"] assert r1.Option.get_Name() == C_OPT_NAME @@ -114,6 +117,8 @@ def test_003(self, request: pytest.FixtureRequest): assert C_OPT_NAME in cfg.m_Data.m_AllOptionsByName assert C_OPT_NAME in file.m_FileData.m_OptionsByName + continue + return # -------------------------------------------------------------------- def test_004__already_defined_in_another_file(self, request: pytest.FixtureRequest): @@ -133,6 +138,7 @@ def test_004__already_defined_in_another_file(self, request: pytest.FixtureReque assert file2 is not None r1 = file1.SetOptionValueItem(C_OPT_NAME, "biha") + assert r1.Option is not None assert ( r1.Option.get_Parent().get_Parent().Private__GetFileData() is file1.m_FileData @@ -145,6 +151,7 @@ def test_004__already_defined_in_another_file(self, request: pytest.FixtureReque with pytest.raises(Exception, match=re.escape(errMsg)): file2.SetOptionValueItem(C_OPT_NAME, "biha") + return # -------------------------------------------------------------------- def test_005__opt_is_defined_in_another_file(self, request: pytest.FixtureRequest): @@ -164,6 +171,7 @@ def test_005__opt_is_defined_in_another_file(self, request: pytest.FixtureReques assert file2 is not None r1 = file1.SetOptionValueItem(C_OPT_NAME, "biha") + assert r1.Option is not None assert ( r1.Option.get_Parent().get_Parent().Private__GetFileData() is file1.m_FileData @@ -176,6 +184,7 @@ def test_005__opt_is_defined_in_another_file(self, request: pytest.FixtureReques with pytest.raises(Exception, match=re.escape(errMsg)): file2.SetOptionValueItem(C_OPT_NAME, "proxima") + return # -------------------------------------------------------------------- def test_006__two_items(self, request: pytest.FixtureRequest): @@ -194,15 +203,18 @@ def test_006__two_items(self, request: pytest.FixtureRequest): r1 = file.SetOptionValueItem(C_OPT_NAME, "biha") assert r1 is not None assert type(r1) is PgCfg_SetOptionResult_Base + assert r1.Option is not None assert r1.Option.get_Value() == ["biha"] r2 = file.SetOptionValueItem(C_OPT_NAME, "proxima") assert r2 is not None assert type(r2) is PgCfg_SetOptionResult_Base assert r2.EventID == PgCfg_SetOptionEventID.VALUE_ITEM_WAS_ADDED + assert r2.Option is not None assert r2.Option.get_Value() == ["biha", "proxima"] assert r1.Option.get_Value() == ["biha", "proxima"] + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/get_Lines/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/get_Lines/test_set001__common.py index a357d71..1882692 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/get_Lines/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationTopLevelFile/get_Lines/test_set001__common.py @@ -71,6 +71,7 @@ def test_001__Lines(self, request: pytest.FixtureRequest): fileLines_v = list(fileLines) assert len(fileLines_v) == 0 + return # -------------------------------------------------------------------- def test_001__Lines__iterator(self, request: pytest.FixtureRequest): @@ -84,6 +85,7 @@ def test_001__Lines__iterator(self, request: pytest.FixtureRequest): set_r = cfg.SetOptionValue("port", 123) assert type(set_r) is PgCfg_SetOptionResult_Base assert isinstance(set_r, PgCfg_SetOptionResult) + assert set_r.Option is not None file = set_r.Option.get_Parent().get_Parent() @@ -95,6 +97,7 @@ def test_001__Lines__iterator(self, request: pytest.FixtureRequest): it1a = it1.__iter__() assert it1a == it1 + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationWriter_Base/DoWork/test_set001__work.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationWriter_Base/DoWork/test_set001__work.py index 1d27b41..7ceb2e9 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationWriter_Base/DoWork/test_set001__work.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationWriter_Base/DoWork/test_set001__work.py @@ -79,6 +79,8 @@ def test_000__empty(self, request: pytest.FixtureRequest): fileContent_n = __class__.Helper__norm_content(fileContent) assert fileContent_n == "" + continue + return # -------------------------------------------------------------------- def test_001(self, request: pytest.FixtureRequest): @@ -146,6 +148,8 @@ def test_001(self, request: pytest.FixtureRequest): fileContent_n = __class__.Helper__norm_content(fileContent) assert fileContent_n == "port = {0}\n".format(portNumber) + continue + return # -------------------------------------------------------------------- def test_003__two_files(self, request: pytest.FixtureRequest): @@ -230,6 +234,9 @@ def test_003__two_files(self, request: pytest.FixtureRequest): fileContent_n = __class__.Helper__norm_content(fileContent) assert fileContent_n == fileData[1] + continue + continue + return # -------------------------------------------------------------------- def test_004__check_truncate(self, request: pytest.FixtureRequest): @@ -280,6 +287,7 @@ def test_004__check_truncate(self, request: pytest.FixtureRequest): assert type(fileContent) is str fileContent_n = __class__.Helper__norm_content(fileContent) assert fileContent_n == "listen_addresses = '*'\n" + return # -------------------------------------------------------------------- def test_E01__file_is_exist(self, request: pytest.FixtureRequest): @@ -338,8 +346,11 @@ def test_E01__file_is_exist(self, request: pytest.FixtureRequest): for fileX in files: assert fileX.m_FileData.m_Status == PgCfgModel__FileStatus.IS_NEW assert fileX.m_FileData.m_LastModifiedTimestamp is None + continue os.remove(file.get_Path()) + continue + return # -------------------------------------------------------------------- def test_E02__external_modification(self, request: pytest.FixtureRequest): @@ -398,8 +409,10 @@ def test_E02__external_modification(self, request: pytest.FixtureRequest): file.m_FileData.m_LastModifiedTimestamp ) ) + return # -------------------------------------------------------------------- + @staticmethod def Helper__norm_content(text: str) -> str: assert text is not None assert type(text) is str diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationWriter_Base/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationWriter_Base/test_set001__common.py index 234f542..7dbc598 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationWriter_Base/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfigurationWriter_Base/test_set001__common.py @@ -40,6 +40,7 @@ def test_001(self, request: pytest.FixtureRequest, optName: str): fileContent = PgCfg_Writer_Base.MakeFileDataContent(cfgWriterCtx, fileData) assert fileContent == optName + " = 234\n" + return # -------------------------------------------------------------------- def test_002__two_opts(self, request: pytest.FixtureRequest): @@ -63,6 +64,7 @@ def test_002__two_opts(self, request: pytest.FixtureRequest): expectedFileContent = "port = 234\nproxima.port = 345\n" assert actualFileContent == expectedFileContent + return # -------------------------------------------------------------------- def test_003__opt1_emptyline_opt2(self, request: pytest.FixtureRequest): @@ -90,6 +92,7 @@ def test_003__opt1_emptyline_opt2(self, request: pytest.FixtureRequest): expectedFileContent = "port = 234\n\nproxima.port = 345\n" assert actualFileContent == expectedFileContent + return # -------------------------------------------------------------------- def test_004__opt1_comment_opt2(self, request: pytest.FixtureRequest): @@ -117,6 +120,7 @@ def test_004__opt1_comment_opt2(self, request: pytest.FixtureRequest): expectedFileContent = "port = 234\n#It is a comment!\nproxima.port = 345\n" assert actualFileContent == expectedFileContent + return # -------------------------------------------------------------------- def test_005__opt_with_list(self, request: pytest.FixtureRequest): @@ -139,6 +143,7 @@ def test_005__opt_with_list(self, request: pytest.FixtureRequest): expectedFileContent = "shared_preload_libraries = 'a'\n" assert actualFileContent == expectedFileContent + return # -------------------------------------------------------------------- def test_006__opt_with_list__empty(self, request: pytest.FixtureRequest): @@ -152,6 +157,7 @@ def test_006__opt_with_list__empty(self, request: pytest.FixtureRequest): r = file.SetOptionValueItem(C_OPT_NAME, "a") + assert r.Option is not None assert type(r.Option.m_OptionData.m_Value) is list r.Option.m_OptionData.m_Value.clear() @@ -166,6 +172,7 @@ def test_006__opt_with_list__empty(self, request: pytest.FixtureRequest): expectedFileContent = "shared_preload_libraries = ''\n" assert actualFileContent == expectedFileContent + return # -------------------------------------------------------------------- def test_007__opt_with_list__mix(self, request: pytest.FixtureRequest): @@ -197,6 +204,7 @@ def test_007__opt_with_list__mix(self, request: pytest.FixtureRequest): expectedFileContent = 'shared_preload_libraries = \'a,"",\\000,",",\\n,\\r,\\f,"\\t",\\\',""""\'\n' assert actualFileContent == expectedFileContent + return # -------------------------------------------------------------------- def test_008__include(self, request: pytest.FixtureRequest): @@ -223,6 +231,7 @@ def test_008__include(self, request: pytest.FixtureRequest): expectedFileContent = "include '{0}'\n".format(C_INCLUDED_FILE_NAME) assert actualFileContent == expectedFileContent + return # -------------------------------------------------------------------- class tagData009: @@ -238,6 +247,7 @@ def __init__(self, d: str, f: str, r: str): self.descr = d self.fileName = f self.result = r + return # -------------------------------------------------------------------- sm_Data009 = [ @@ -290,6 +300,7 @@ def test_009__include__mix( ) assert actualFileContent == data009.result + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration__AllFiles/GetFileByName/test_set001__common.py b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration__AllFiles/GetFileByName/test_set001__common.py index 63ee038..2470ae4 100644 --- a/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration__AllFiles/GetFileByName/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Objects/PostgresConfiguration__AllFiles/GetFileByName/test_set001__common.py @@ -35,6 +35,7 @@ def test_001(self, request: pytest.FixtureRequest): .Private__GetFileData() == file1.m_FileData ) + return # -------------------------------------------------------------------- def test_002__unk_file_name(self, request: pytest.FixtureRequest): @@ -51,6 +52,7 @@ def test_002__unk_file_name(self, request: pytest.FixtureRequest): with pytest.raises(Exception, match=re.escape(errMsg)): cfg.get_AllFiles().GetFileByName(C_FILE_NAME) + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Options/STD/generic/bool_option/test_set001__common.py b/tests/implementation/v00/configuration_std/Options/STD/generic/bool_option/test_set001__common.py index 2093079..281e18e 100644 --- a/tests/implementation/v00/configuration_std/Options/STD/generic/bool_option/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Options/STD/generic/bool_option/test_set001__common.py @@ -43,6 +43,7 @@ class tagData001: def __init__(self, set_value: typing.Any, get_value: bool): self.set_value = set_value self.get_value = get_value + return # -------------------------------------------------------------------- sm_Data001: typing.List[tagData001] = [ @@ -138,6 +139,8 @@ def test_001__ok(self, optionName: str): assert actualValue == data.get_value except Exception as e: logging.error(str(e)) + continue + return # -------------------------------------------------------------------- class tagData002: @@ -189,6 +192,8 @@ def test_002__cant_convert_value(self, optionName: str): cfg.SetOptionValue(optionName, data.set_value) except Exception as e: logging.error(str(e)) + continue + return # -------------------------------------------------------------------- class tagData003: @@ -234,6 +239,8 @@ def test_003__bad_option_value_type(self, optionName: str): cfg.SetOptionValue(optionName, data.set_value) except Exception as e: logging.error(str(e)) + continue + return # -------------------------------------------------------------------- class tagData101_Assign: @@ -245,6 +252,7 @@ def __init__(self, sign: str, text: str): assert type(text) is str self.sign = sign self.text = text + return # -------------------------------------------------------------------- sm_Data101_assigns: typing.List[tagData101_Assign] = [ @@ -272,6 +280,7 @@ def __init__(self, sign: str, quote1: str, quote2: str): self.sign = sign self.quote1 = quote1 self.quote2 = quote2 + return # -------------------------------------------------------------------- sm_Data101_quotes: typing.List[tagData101_Quote] = [ @@ -288,6 +297,7 @@ class tagData101_Value: def __init__(self, source: typing.Any, result: bool): self.source = source self.result = result + return # -------------------------------------------------------------------- sm_Data101_values: typing.List[tagData101_Value] = [ @@ -388,6 +398,10 @@ def test_101__parse_file_line(self, optionName: str): ) except Exception as e: logging.error(str(e)) + continue + continue + continue + return # ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/implementation/v00/configuration_std/Options/STD/listen_addresses/test_set001__common.py b/tests/implementation/v00/configuration_std/Options/STD/listen_addresses/test_set001__common.py index ee9cea5..0fc7710 100644 --- a/tests/implementation/v00/configuration_std/Options/STD/listen_addresses/test_set001__common.py +++ b/tests/implementation/v00/configuration_std/Options/STD/listen_addresses/test_set001__common.py @@ -29,6 +29,7 @@ def test_001(self, request: pytest.FixtureRequest): set_r = cfg.SetOptionValue(__class__.C_OPTION_NAME, "*") + assert set_r.Option is not None assert set_r.Option.get_Name() == __class__.C_OPTION_NAME assert set_r.Option.get_Value() == "*" @@ -58,6 +59,7 @@ def test_001(self, request: pytest.FixtureRequest): writeResult = PgCfg_Writer_Base.MakeFileDataContent(writeCtx, file.m_FileData) assert writeResult == "listen_addresses = '*'\n" + return # -------------------------------------------------------------------- def test_E01__bad_value(self, request: pytest.FixtureRequest): @@ -73,6 +75,7 @@ def test_E01__bad_value(self, request: pytest.FixtureRequest): ), ): cfg.SetOptionValue(__class__.C_OPTION_NAME, 123) + return # //////////////////////////////////////////////////////////////////////////////