diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_init.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_init.py b/tests/test_init.py index 55153f4..f1b20f8 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -369,3 +369,20 @@ class TestRepeatedInit(unittest.TestCase): self.assertEqual( tomllib.loads(text)["reporter"]["name"], "A Reporter" ) + + def test_the_footer_stays_at_the_end_after_a_preserved_section(self): + # It says further sections are added below it, so a preserved table + # appended underneath made it a comment about nothing. + relays = {"trusted_relays": ["192.0.2.0/24"], "cases": ""} + answered = dict(relays, reporter_name="A Reporter", + reporter_email="r@example.org") + with tempfile.TemporaryDirectory() as tmp: + path = pathlib.Path(tmp) / "config.toml" + init.write(path, answered) + init.write(path, relays, force=True) + + text = path.read_text().rstrip("\n") + self.assertTrue( + text.endswith("# [reporting] - abuse-desk reporting defaults"), + f"footer is not last:\n{text}", + ) |
