Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blurb: replace spaces with underscores in news directory #499

Merged
merged 17 commits into from
Mar 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add glob_blurbs test for sorting by filename
hugovk committed Jul 23, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 8e53d4a99f0c3d1d11066809f4de653e65584f62
35 changes: 35 additions & 0 deletions blurb/tests/test_blurb.py
Original file line number Diff line number Diff line change
@@ -71,6 +71,41 @@ def test_glob_blurbs_next(fs):
assert set(filenames) == set(fake_news_entries)


def test_glob_blurbs_sort_order(fs):
"""
It shouldn't make a difference to sorting whether
section names have spaces or underscores.
"""
# Arrange
fake_news_entries = (
"Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-01-00.gh-issue-33331.Pf_BI1.rst",
"Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-02-00.gh-issue-33332.Pf_BI2.rst",
"Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-03-00.gh-issue-33333.Pf_BI3.rst",
"Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-04-00.gh-issue-33334.Pf_BI4.rst",
)
# As fake_news_entries, but reverse sorted by *filename* only
expected = [
"Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-04-00.gh-issue-33334.Pf_BI4.rst",
"Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-03-00.gh-issue-33333.Pf_BI3.rst",
"Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-02-00.gh-issue-33332.Pf_BI2.rst",
"Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-01-00.gh-issue-33331.Pf_BI1.rst",
]
fake_readmes = (
"Misc/NEWS.d/next/Library/README.rst",
"Misc/NEWS.d/next/Core and Builtins/README.rst",
"Misc/NEWS.d/next/Tools-Demos/README.rst",
"Misc/NEWS.d/next/C API/README.rst",
)
for fn in fake_news_entries + fake_readmes:
fs.create_file(fn)

# Act
filenames = blurb.glob_blurbs("next")

# Assert
assert filenames == expected


@pytest.mark.parametrize(
"news_entry, expected_section",
(