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

Fix A Bug in GitHubSectionChangeNot.get_thread_url #72

Merged
merged 4 commits into from
Feb 7, 2025

Conversation

Bibo-Joshi
Copy link
Owner

closes #71

@Bibo-Joshi Bibo-Joshi added the bug Something isn't working label Feb 7, 2025
Copy link

codecov bot commented Feb 7, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
442 1 441 1
View the top 1 failed test(s) by shortest run time
tests.concrete.sections.test_sectionversionnote.TestSectionVersionNote::test_render
Stack Traces | 0.007s run time
self = <tests.concrete.sections.test_sectionversionnote.TestSectionVersionNote object at 0x000002759261C200>
section_version_note = <chango.concrete.sections._sectionversionnote.SectionVersionNote object at 0x0000027594A84E00>

        def test_render(self, section_version_note):
            section_version_note.add_change_note(
                DummySectionChangeNote(
                    slug="slug1",
                    uid="uid1",
                    req_section="change note 1 req.\nWith multiple lines.",
                    opt_section="change note 1 opt.",
                    pull_requests=[
                        PullRequest(
                            uid="pr1", closes_threads=("thread1", "thread2"), author_uid="author1"
                        ),
                        PullRequest(uid="pr2", author_uid="author2"),
                    ],
                )
            )
            section_version_note.add_change_note(
                DummySectionChangeNote(slug="slug2", uid="uid2", req_section="change note 2 req.")
            )
            section_version_note.add_change_note(
                DummySectionChangeNote(
                    slug="slug3",
                    uid="uid3",
                    req_section="change note 3 req.",
                    pull_requests=[PullRequest(uid="pr_a", author_uid="author_b")],
                )
            )
>           assert (
                section_version_note.render("rst")
                == """\
    Optional Section
    ----------------
    
    - change note 1 opt.
    
    Required Section
    ----------------
    
    - change note 1 req.
    
      With multiple lines.
    
      (`#pr1 <https://github..../my-repo/pull/pr1>`_ by `@author1 \
    <https://github.com/author1>`_ closes `#thread1 \
    <https://github..../my-repo/issue/thread1>`_, `#thread2 \
    <https://github..../my-repo/issue/thread2>`_; `#pr2 \
    <https://github..../my-repo/pull/pr2>`_ by `@author2 <https://github.com/author2>`_)
    - change note 2 req.
    - change note 3 req. (`#pr_a <https://github..../my-repo/pull/pr_a>`_ by \
    `@author_b <https://github.com/author_b>`_)\
    """
            )
E           AssertionError: assert 'Optional Sec.../author_b>`_)' == 'Optional Sec.../author_b>`_)'
E             
E               Optional Section
E               ----------------
E               
E               - change note 1 opt.
E               
E               Required Section
E               ----------------
E               
E               - change note 1 req.
E               
E                 With multiple lines.
E               
E             -   (`#pr1 <https://github..../my-repo/pull/pr1>`_ by `@author1 <https://github.com/author1>`_ closes `#thread1 <https://github..../my-repo/issue/thread1>`_, `#thread2 <https://github..../my-repo/issue/thread2>`_; `#pr2 <https://github..../my-repo/pull/pr2>`_ by `@author2 <https://github.com/author2>`_)
E             +   (`#pr1 <https://github..../my-repo/pull/pr1>`_ by `@author1 <https://github.com/author1>`_ closes `#thread1 <https://github..../my-repo/issues/thread1>`_, `#thread2 <https://github..../my-repo/issues/thread2>`_; `#pr2 <https://github..../my-repo/pull/pr2>`_ by `@author2 <https://github.com/author2>`_)
E             ?                                                                                                                                                                        +                                                                    +
E               - change note 2 req.
E               - change note 3 req. (`#pr_a <https://github..../my-repo/pull/pr_a>`_ by `@author_b <https://github.com/author_b>`_)

tests\concrete\sections\test_sectionversionnote.py:87: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@Bibo-Joshi Bibo-Joshi merged commit 870dfd9 into main Feb 7, 2025
17 checks passed
@Bibo-Joshi Bibo-Joshi deleted the fix-issues-url branch February 7, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHubSectionChangeNot.get_thread_url is broken
1 participant