Example #1
0
    def test_obj_anchor_tag_pr(self):
        """Assert links to pull requests are generated correctly"""
        pr = model.PullRequest(title='The pull request summary')
        expected_markup = ('<a href="http://eh/" title="The pull request '
                           'summary">My Pull Request</a>')
        element = pfmarkdown._obj_anchor_tag(
            'jcline', None, None, pr, 'My Pull Request')

        self.assertEqual(expected_markup, ElementTree.tostring(element))
Example #2
0
    def test_obj_anchor_tag_pr(self):
        """Assert links to pull requests are generated correctly"""
        pr = model.PullRequest(title='The pull request summary')
        expected_markup = ('<a href="http://eh/" title="The pull request '
                           'summary">My Pull Request</a>')
        element = pfmarkdown._obj_anchor_tag(
            'jcline', None, None, pr, 'My Pull Request')

        self.assertEqual(expected_markup, ElementTree.tostring(element))
    def test_obj_anchor_tag_private_issue(self):
        """Assert links to private issues hide the title"""
        issue = model.Issue(title='The private issue summary',
                            content='The issue description',
                            private=True)
        expected_markup = (b'<a href="http://eh/" title="Private issue">'
                           b'My Issue</a>')
        element = pfmarkdown._obj_anchor_tag('jcline', None, None, issue,
                                             'My Issue')

        self.assertEqual(expected_markup, ElementTree.tostring(element))
Example #4
0
    def test_obj_anchor_tag_issue(self):
        """Assert links to issues are generated correctly"""
        issue = model.Issue(
            title='The issue summary',
            content='The issue description',
        )
        expected_markup = ('<a href="http://eh/" title="The issue summary">'
                           'My Issue</a>')
        element = pfmarkdown._obj_anchor_tag(
            'jcline', None, None, issue, 'My Issue')

        self.assertEqual(expected_markup, ElementTree.tostring(element))
Example #5
0
    def test_obj_anchor_tag_issue(self):
        """Assert links to issues are generated correctly"""
        issue = model.Issue(
            title='The issue summary',
            content='The issue description',
        )
        expected_markup = ('<a href="http://eh/" title="The issue summary">'
                           'My Issue</a>')
        element = pfmarkdown._obj_anchor_tag(
            'jcline', None, None, issue, 'My Issue')

        self.assertEqual(expected_markup, ElementTree.tostring(element))
Example #6
0
    def test_obj_anchor_tag_private_issue(self):
        """Assert links to private issues hide the title"""
        issue = model.Issue(
            title='The private issue summary',
            content='The issue description',
            private=True
        )
        expected_markup = ('<a href="http://eh/" title="Private issue">'
                           'My Issue</a>')
        element = pfmarkdown._obj_anchor_tag(
            'jcline', None, None, issue, 'My Issue')

        self.assertEqual(expected_markup, ElementTree.tostring(element))
Example #7
0
    def test_obj_anchor_tag_private_issue(self):
        """Assert links to private issues hide the title"""
        issue = model.Issue(
            title="The private issue summary",
            content="The issue description",
            private=True,
        )
        expected_markup = (
            b'<a href="http://eh/" title="Private issue">' b"My Issue</a>"
        )
        element = pfmarkdown._obj_anchor_tag(
            "jcline", None, None, issue, "My Issue"
        )

        self.assertEqual(expected_markup, ElementTree.tostring(element))