@@ -1,5 +1,6 @@ | |||
| 1 | 1 | # Copyright The IETF Trust 2026, All Rights Reserved | |
| 2 | 2 | import json | |
| 3 | + import re | ||
| 3 | 4 | from pathlib import Path | |
| 4 | 5 | from unittest import mock | |
| 5 | 6 | ||
@@ -131,17 +132,20 @@ def test_create_rfc_txt_index(self, mock_save_blob, mock_save_file): | |||
| 131 | 132 | "0123 Not Issued.", | |
| 132 | 133 | contents, | |
| 133 | 134 | ) | |
| 135 | + | ||
| 136 | + # strip whitespace so line breaks don't interfere with the next few tests | ||
| 137 | + stripped_contents = re.sub(r"\s+", " ", mock_save_blob.call_args[0][1]) | ||
| 134 | 138 | self.assertIn( | |
| 135 | 139 | f"{self.april_fools_rfc.rfc_number} {self.april_fools_rfc.title}", | |
| 136 | - contents, | ||
| 140 | + stripped_contents, | ||
| 137 | 141 | ) | |
| 138 | 142 | self.assertIn("1 April 2020", contents) # from the April 1 RFC | |
| 139 | 143 | self.assertIn( | |
| 140 | 144 | f"{self.rfc.rfc_number} {self.rfc.title}", | |
| 141 | - contents, | ||
| 145 | + stripped_contents, | ||
| 142 | 146 | ) | |
| 143 | - self.assertIn("April 2021", contents) # from the non-April 1 RFC | ||
| 144 | - self.assertNotIn("1 April 2021", contents) | ||
| 147 | + self.assertIn("April 2021", stripped_contents) # from the non-April 1 RFC | ||
| 148 | + self.assertNotIn("1 April 2021", stripped_contents) | ||
| 145 | 149 | ||
| 146 | 150 | @override_settings(RFCINDEX_INPUT_PATH="input/") | |
| 147 | 151 | @mock.patch("ietf.sync.rfcindex.save_to_filesystem") | |
0 commit comments