@@ -93,6 +93,65 @@ def test_sortable_datetime():
9393 assert blurb .sortable_datetime () == "2025-01-07-16-28-41"
9494
9595
96+ def test_glob_blurbs_next (fs ):
97+ # Arrange
98+ fake_news_entries = (
99+ "Misc/NEWS.d/next/Library/2022-04-11-18-34-33.gh-issue-11111.pC7gnM.rst" ,
100+ "Misc/NEWS.d/next/Core and Builtins/2023-03-17-12-09-45.gh-issue-33333.Pf_BI7.rst" ,
101+ "Misc/NEWS.d/next/Tools-Demos/2023-03-21-01-27-07.gh-issue-44444.2F1Byz.rst" ,
102+ "Misc/NEWS.d/next/C API/2023-03-27-22-09-07.gh-issue-66666.3SN8Bs.rst" ,
103+ )
104+ fake_readmes = (
105+ "Misc/NEWS.d/next/Library/README.rst" ,
106+ "Misc/NEWS.d/next/Core and Builtins/README.rst" ,
107+ "Misc/NEWS.d/next/Tools-Demos/README.rst" ,
108+ "Misc/NEWS.d/next/C API/README.rst" ,
109+ )
110+ for fn in fake_news_entries + fake_readmes :
111+ fs .create_file (fn )
112+
113+ # Act
114+ filenames = blurb .glob_blurbs ("next" )
115+
116+ # Assert
117+ assert set (filenames ) == set (fake_news_entries )
118+
119+
120+ def test_glob_blurbs_sort_order (fs ):
121+ """
122+ It shouldn't make a difference to sorting whether
123+ section names have spaces or underscores.
124+ """
125+ # Arrange
126+ fake_news_entries = (
127+ "Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-01-00.gh-issue-33331.Pf_BI1.rst" ,
128+ "Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-02-00.gh-issue-33332.Pf_BI2.rst" ,
129+ "Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-03-00.gh-issue-33333.Pf_BI3.rst" ,
130+ "Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-04-00.gh-issue-33334.Pf_BI4.rst" ,
131+ )
132+ # As fake_news_entries, but reverse sorted by *filename* only
133+ expected = [
134+ "Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-04-00.gh-issue-33334.Pf_BI4.rst" ,
135+ "Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-03-00.gh-issue-33333.Pf_BI3.rst" ,
136+ "Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-02-00.gh-issue-33332.Pf_BI2.rst" ,
137+ "Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-01-00.gh-issue-33331.Pf_BI1.rst" ,
138+ ]
139+ fake_readmes = (
140+ "Misc/NEWS.d/next/Library/README.rst" ,
141+ "Misc/NEWS.d/next/Core and Builtins/README.rst" ,
142+ "Misc/NEWS.d/next/Tools-Demos/README.rst" ,
143+ "Misc/NEWS.d/next/C API/README.rst" ,
144+ )
145+ for fn in fake_news_entries + fake_readmes :
146+ fs .create_file (fn )
147+
148+ # Act
149+ filenames = blurb .glob_blurbs ("next" )
150+
151+ # Assert
152+ assert filenames == expected
153+
154+
96155@pytest .mark .parametrize (
97156 "news_entry, expected_section" ,
98157 (
0 commit comments