Skip to content

Commit a98bbfd

Browse files
authored
Merge pull request #2619 from sebix/ruamel
tests: ruamel.yaml 0.18.13 compatibility
2 parents 22d22c3 + 5d22ffa commit a98bbfd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
4242
### Tests
4343
- `intelmq.tests.lib.test_pipeline.TestAmqp.test_acknowledge`: Skip on all Python versions when running on CI (PR#2602 by Sebastian Wagner).
4444
- `.github/workflows/codespell.yml`, `debian-package.yml`, `regexploit.yml`: Upgrade to `ubuntu-latest` runners (PR#2602 by Sebastian Wagner).
45+
- `intelmq.test.test_conf`: With changed behaviour in ruamel.yaml on line wrapping since version 0.18.13, only test the parsabilty of `runtime.yaml` (PR#2619 by Sebastian Wagner).
4546

4647
### Tools
4748
- `intelmq.bin.intelmq_psql_initdb`: Use `JSONB` type by default, Postgres supports it since version 9 (PR#2597 by Sebastian Wagner).

intelmq/tests/test_conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ def test_harmonization(self):
8282
self.assertGreater(value['length'], 0)
8383
getattr(harmonization, value['type'])
8484

85+
# Line wrapping behaves differently since ruamel.yaml version 0.18.13. Additionally it adds spaces at the end of continued lines.
86+
# https://sourceforge.net/p/ruamel-yaml/code/ci/375c4db4c7c5fad61e149fc0690e50229df23ab3/
87+
# So just test now that the file is parseable
8588
def test_runtime_syntax(self):
86-
""" Test if runtime.yaml has correct syntax. """
89+
""" Test if runtime.yaml has correct syntax (parseable). """
8790
with open(CONF_FILES['runtime']) as fhandle:
8891
fcontent = fhandle.read()
8992
interpreted = yaml.load(fcontent)
90-
buf = io.BytesIO()
91-
yaml.dump(interpreted, buf)
92-
self.assertEqual(buf.getvalue().decode(), fcontent)
9393

9494

9595
class CerberusTests(unittest.TestCase):

0 commit comments

Comments
 (0)