Exemple #1
0
    def test_tags(self):
        # Test valid tags.
        for tag in ('#t', '#tag', '#TAG', '#tag123'):
            expected = '%s <div class="tags">%s</div>' % (tag, TAG_TMPL.format('', tag[1:]),)
            eq_(format_update(tag), expected)

        # Test invalid tags.
        for tag in ('#1', '#.abc', '#?abc'):
            eq_(format_update(tag), tag)
Exemple #2
0
    def test_tags(self):
        # Test valid tags.
        for tag in ("#t", "#tag", "#TAG", "#tag123"):
            expected = '%s <div class="tags">%s</div>' % (tag, TAG_TMPL.format("", tag[1:]))
            eq_(format_update(tag), expected)

        # Test invalid tags.
        for tag in ("#1", "#.abc", "#?abc"):
            eq_(format_update(tag), tag)
Exemple #3
0
 def test_format_update(self):
     p = Project(name="mdndev", slug="mdndev", repo_url="https://github.com/mozilla/kuma")
     app.db.session.add(p)
     app.db.session.commit()
     content = "#merge pull #1 and pR 2 to fix bug #3 and BUg 4"
     formatted_update = format_update(content, project=p)
     ok_("tag-merge" in formatted_update)
     ok_("pull/1" in formatted_update)
     ok_("pull/2" in formatted_update)
     ok_("show_bug.cgi?id=3" in formatted_update)
     ok_("show_bug.cgi?id=4" in formatted_update)
Exemple #4
0
 def test_format_update(self):
     p = Project(name='mdndev', slug='mdndev',
                 repo_url='https://github.com/mozilla/kuma')
     app.db.session.add(p)
     app.db.session.commit()
     content = "#merge pull #1 and pR 2 to fix bug #3 and BUg 4"
     formatted_update = format_update(content, project=p)
     ok_('tag-merge' in formatted_update)
     ok_('pull/1' in formatted_update)
     ok_('pull/2' in formatted_update)
     ok_('show_bug.cgi?id=3' in formatted_update)
     ok_('show_bug.cgi?id=4' in formatted_update)