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)
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)
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')
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')