示例#1
0
 def expect(payload, expected, user=''):
     # strip the excess html from the result down to the text class,
     # the opticon class, and the rendered text
     result = filters.do_render_status(payload, user)
     result = re.sub(r'<span class="text-|octicon octicon-|</span>', '', result)
     result = str(result).replace('">', ' ')
     self.assertEqual(result, expected)
示例#2
0
 def expect(payload, expected, user=''):
     # strip the excess html from the result down to the text class,
     # the opticon class, and the rendered text
     result = str(filters.do_render_status(payload, user))
     result = re.sub(r'<span class="text-|octicon octicon-|</span>', '', result)
     result = result.replace('">', ' ')
     self.assertEqual(result, expected)
示例#3
0
 def test_render_status_basic(self):
     payload = {'status': {'ci': ['pending', '', '']}}
     self.assertEqual(
         str(filters.do_render_status(payload, '')),
         '<span class="text-pending octicon octicon-primitive-dot">'
         '</span>Pending')
示例#4
0
 def test_render_status_basic(self):
     payload = {'status': {'ci': ['pending', '', '']}}
     self.assertEqual(str(filters.do_render_status(payload, '')),
         '<span class="text-pending octicon octicon-primitive-dot" title="pending tests">'
         '</span>Pending')