← 返回首页
chore: strip whitespace in test (#10874) · ietf-tools/datatracker@4165235 · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Commit 4165235

Browse files
chore: strip whitespace in test (#10874)
1 parent adbaaa5 commit 4165235

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎ietf/sync/tests_rfcindex.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright The IETF Trust 2026, All Rights Reserved
22
import json
3+
import re
34
from pathlib import Path
45
from unittest import mock
56

@@ -131,17 +132,20 @@ def test_create_rfc_txt_index(self, mock_save_blob, mock_save_file):
131132
"0123 Not Issued.",
132133
contents,
133134
)
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])
134138
self.assertIn(
135139
f"{self.april_fools_rfc.rfc_number} {self.april_fools_rfc.title}",
136-
contents,
140+
stripped_contents,
137141
)
138142
self.assertIn("1 April 2020", contents) # from the April 1 RFC
139143
self.assertIn(
140144
f"{self.rfc.rfc_number} {self.rfc.title}",
141-
contents,
145+
stripped_contents,
142146
)
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)
145149

146150
@override_settings(RFCINDEX_INPUT_PATH="input/")
147151
@mock.patch("ietf.sync.rfcindex.save_to_filesystem")

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.