diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:22:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:22:27 +0000 |
commit | a6d69be7e62fc037a0e9d9872193c79b63f03ce0 (patch) | |
tree | 696a4872ad40d7332aee8e4e1341189b834bc391 /tests/test_parser.py | |
parent | Adding upstream version 0.1.43. (diff) | |
download | debputy-a6d69be7e62fc037a0e9d9872193c79b63f03ce0.tar.xz debputy-a6d69be7e62fc037a0e9d9872193c79b63f03ce0.zip |
Adding upstream version 0.1.44.upstream/0.1.44
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_parser.py')
-rw-r--r-- | tests/test_parser.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/tests/test_parser.py b/tests/test_parser.py index 4aee024..1c84445 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -124,7 +124,10 @@ def test_parsing_variables_reserved(manifest_parser_pkg_foo, varname): with pytest.raises(ManifestParseException) as e_info: manifest_parser_pkg_foo.parse_manifest(fd=content) - msg = f'The variable "{varname}" is already reserved/defined. Error triggered by definitions.variables.{varname}.' + msg = ( + f'The variable "{varname}" is already reserved/defined.' + f" Error triggered by definitions.variables.{varname} [Line 4 column 4]." + ) assert normalize_doc_link(e_info.value.args[0]) == msg @@ -163,7 +166,7 @@ def test_parsing_variables_unused(manifest_parser_pkg_foo): msg = ( 'The variable "UNUSED" is unused. Either use it or remove it.' - " The variable was declared at definitions.variables.UNUSED." + " The variable was declared at definitions.variables.UNUSED [Line 4 column 4]." ) assert normalize_doc_link(e_info.value.args[0]) == msg @@ -181,7 +184,7 @@ def test_parsing_package_foo_empty(manifest_parser_pkg_foo): manifest_parser_pkg_foo.parse_manifest(fd=content) msg = ( - "The attribute packages.foo must be a non-empty mapping. Please see" + "The attribute packages.foo [Line 3 column 4] must be a non-empty mapping. Please see" " {{DEBPUTY_DOC_ROOT_DIR}}/MANIFEST-FORMAT.md#binary-package-rules for the documentation." ) assert normalize_doc_link(e_info.value.args[0]) == msg @@ -238,8 +241,8 @@ def test_create_symlinks_missing_path(manifest_parser_pkg_foo): manifest_parser_pkg_foo.parse_manifest(fd=content) msg = ( - "The following keys were required but not present at packages.foo.transformations[0].create-symlink: 'path'" - " (Documentation: " + "The following keys were required but not present at packages.foo.transformations[0].create-symlink" + " [Line 5 column 12]: 'path' (Documentation: " "{{DEBPUTY_DOC_ROOT_DIR}}/MANIFEST-FORMAT.md#create-symlinks-transformation-rule-create-symlink)" ) assert normalize_doc_link(e_info.value.args[0]) == msg @@ -263,7 +266,7 @@ def test_create_symlinks_unknown_replacement_rule(manifest_parser_pkg_foo): manifest_parser_pkg_foo.parse_manifest(fd=content) msg = ( - 'The attribute "packages.foo.transformations[0].create-symlink.replacement-rule <Search for: usr/share/foo>"' + 'The attribute "packages.foo.transformations[0].create-symlink.replacement-rule [Line 8 column 32]"' " did not have a valid structure/type: Value (golf) must be one of the following literal values:" ' "error-if-exists", "error-if-directory", "abort-on-non-empty-directory", "discard-existing"' ) @@ -286,8 +289,8 @@ def test_create_symlinks_missing_target(manifest_parser_pkg_foo): manifest_parser_pkg_foo.parse_manifest(fd=content) msg = ( - "The following keys were required but not present at packages.foo.transformations[0].create-symlink: 'target'" - " (Documentation: " + "The following keys were required but not present at packages.foo.transformations[0].create-symlink" + " [Line 5 column 12]: 'target' (Documentation: " "{{DEBPUTY_DOC_ROOT_DIR}}/MANIFEST-FORMAT.md#create-symlinks-transformation-rule-create-symlink)" ) assert normalize_doc_link(e_info.value.args[0]) == msg @@ -310,7 +313,7 @@ def test_create_symlinks_not_normalized_path(manifest_parser_pkg_foo): manifest_parser_pkg_foo.parse_manifest(fd=content) expected = ( - 'The path "../bar" provided in packages.foo.transformations[0].create-symlink.path <Search for: ../bar>' + 'The path "../bar" provided in packages.foo.transformations[0].create-symlink.path [Line 6 column 20]' ' should be relative to the root of the package and not use any ".." or "." segments.' ) assert e_info.value.args[0] == expected @@ -332,7 +335,7 @@ def test_unresolvable_subst_in_source_context(manifest_parser_pkg_foo): expected = ( "The variable {{PACKAGE}} is not available while processing installations[0].install.as" - " <Search for: foo.sh>." + " [Line 5 column 7]." ) assert e_info.value.args[0] == expected @@ -397,7 +400,7 @@ def test_yaml_octal_mode_int(manifest_parser_pkg_foo): manifest_parser_pkg_foo.parse_manifest(fd=content) msg = ( - 'The attribute "packages.foo.transformations[0].path-metadata.mode <Search for: usr/share/bar>" did not' + 'The attribute "packages.foo.transformations[0].path-metadata.mode [Line 7 column 20]" did not' " have a valid structure/type: The attribute must be a FileSystemMode (string)" ) |