Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from .......TestServices import TestServices
from .......CfgFileReader import CfgFileReader
from .......ErrorMessageBuilder import ErrorMessageBuilder

import pytest
import typing
Expand Down Expand Up @@ -302,7 +303,13 @@ def test_204__option_without_value(
src = CfgFileReader("port" + data204_tail)

with pytest.raises(
Exception, match=re.escape("Option [port] in line 1 does not have a value.")
Exception,
match=re.escape(
ErrorMessageBuilder.CfgReader__OptionWithoutValue(
"port",
1,
),
),
):
PgCfg_Reader_Base.LoadFileContent(file1, src)
return
Expand Down Expand Up @@ -537,7 +544,10 @@ def test_3E01__optionQ__no_end_quote(
with pytest.raises(
Exception,
match=re.escape(
"Value of quoted option [listen_addresses] is not completed. Line 1."
ErrorMessageBuilder.CfgReader__EndQuotedOptionValueIsNotFound(
"listen_addresses",
1,
),
),
):
PgCfg_Reader_Base.LoadFileContent(file1, src)
Expand Down Expand Up @@ -576,7 +586,10 @@ def test_3E02__optionQ__incompleted_escape(
with pytest.raises(
Exception,
match=re.escape(
"Escape in a value of quoted option [listen_addresses] is not completed. Line 1."
ErrorMessageBuilder.CfgReader__IncompletedEscapeInQuotedOptionValue(
"listen_addresses",
1,
),
),
):
PgCfg_Reader_Base.LoadFileContent(file1, src)
Expand All @@ -598,7 +611,12 @@ def test_3E03__optionQ__unk_escaped_symbol(self, request: pytest.FixtureRequest)
with pytest.raises(
Exception,
match=re.escape(
"Unknown escape symbol [a] in a value of quoted option [listen_addresses]. Line 1. Column 20."
ErrorMessageBuilder.CfgReader__UnknownEscapedSymbolInQuotedOptionValue(
"listen_addresses",
1,
20,
"a",
),
),
):
PgCfg_Reader_Base.LoadFileContent(file1, src)
Expand Down Expand Up @@ -646,7 +664,12 @@ def test_4E01__empty_path(self, request: pytest.FixtureRequest):
src = CfgFileReader("include ''\n")

with pytest.raises(
Exception, match=re.escape("Include in line 1 has an empty path.")
Exception,
match=re.escape(
ErrorMessageBuilder.CfgReader__IncludeHasEmptyPath(
1,
),
),
):
PgCfg_Reader_Base.LoadFileContent(file1, src)
return
Expand Down Expand Up @@ -680,7 +703,11 @@ def test_4E02__incompleted_path(

with pytest.raises(
Exception,
match=re.escape("The end of an include path is not found. Line 1."),
match=re.escape(
ErrorMessageBuilder.CfgReader__EndOfIncludePathIsNotFound(
1,
),
),
):
PgCfg_Reader_Base.LoadFileContent(file1, src)
return
Expand All @@ -701,7 +728,11 @@ def test_4E03__unknown_escape_symbol(self, request: pytest.FixtureRequest):
with pytest.raises(
Exception,
match=re.escape(
"Unknown escape symbol [a] in an include path. Line 1. Column 11."
ErrorMessageBuilder.CfgReader__UnknownEscapedSymbolInInclude(
1,
11,
"a",
),
),
):
PgCfg_Reader_Base.LoadFileContent(file1, src)
Expand Down Expand Up @@ -733,7 +764,11 @@ def test_4E04__incompleted_escape(

with pytest.raises(
Exception,
match=re.escape("Escape in an include path is not completed. Line 1."),
match=re.escape(
ErrorMessageBuilder.CfgReader__IncompletedEscapeInInclude(
1,
),
),
):
PgCfg_Reader_Base.LoadFileContent(file1, src)
return
Expand Down Expand Up @@ -777,7 +812,11 @@ def test_4E05__include_without_path(

with pytest.raises(
Exception,
match=re.escape("Include directive in line 1 does not have a path."),
match=re.escape(
ErrorMessageBuilder.CfgReader__IncludeWithoutPath(
1,
),
),
):
PgCfg_Reader_Base.LoadFileContent(file1, src)
return
Expand Down
Loading