File: test_sort_whatsnew_note.py

package info (click to toggle)
pandas 2.2.3%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,784 kB
  • sloc: python: 422,228; ansic: 9,190; sh: 270; xml: 102; makefile: 83
file content (30 lines) | stat: -rw-r--r-- 885 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from scripts.sort_whatsnew_note import sort_whatsnew_note


def test_sort_whatsnew_note() -> None:
    content = (
        ".. _whatsnew_200:\n"
        "\n"
        "What's new in 2.0.0 (March XX, 2023)\n"
        "------------------------------------\n"
        "\n"
        "Timedelta\n"
        "^^^^^^^^^\n"
        "- Bug in :meth:`Timedelta.round` (:issue:`51494`)\n"
        "- Bug in :class:`TimedeltaIndex` (:issue:`51575`)\n"
        "\n"
    )
    expected = (
        ".. _whatsnew_200:\n"
        "\n"
        "What's new in 2.0.0 (March XX, 2023)\n"
        "------------------------------------\n"
        "\n"
        "Timedelta\n"
        "^^^^^^^^^\n"
        "- Bug in :class:`TimedeltaIndex` (:issue:`51575`)\n"
        "- Bug in :meth:`Timedelta.round` (:issue:`51494`)\n"
        "\n"
    )
    result = sort_whatsnew_note(content)
    assert result == expected