Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)