Skip to content

blurb: replace spaces with underscores in news directory #499

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

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
  • Loading branch information
hugovk committed Jul 23, 2023
commit 8e53d4a99f0c3d1d11066809f4de653e65584f62
35 changes: 35 additions & 0 deletions blurb/tests/test_blurb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
(
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy