def test_convert_highlighted_and_bolded_phrase(self): attributes = [STYLE_EVERNOTE_HIGHLIGHT_BG, STYLE_EVERNOTE_HIGHLIGHT] for styles in permutations(attributes, len(attributes)): enml = div("Lorem ipsum ", b("dolor sit amet", styles=styles)) actual = convert_div_excerpt(enml) expected = p("Lorem ipsum ", b(mark("dolor sit amet"))) self.assertEqual(actual, expected, 'Failed with styles {}'.format(styles))
def test_convert_legacy_highlight_in_bold_phrase(self): attributes = [ STYLE_EVERNOTE_BOLD, STYLE_EVERNOTE_HIGHLIGHT_BG, STYLE_EVERNOTE_HIGHLIGHT ] for hl_styles in permutations(attributes, len(attributes)): enml = div(span("Lorem ipsum ", styles=STYLE_EVERNOTE_BOLD), span("dolor sit amet", styles=hl_styles)) actual = convert_div_excerpt(enml) expected = p(b("Lorem ipsum ", mark("dolor sit amet"))) self.assertEqual(actual, expected, 'Failed with styles {}'.format(hl_styles))
def test_convert_legacy_bold_phrase(self): enml = div("Lorem ipsum ", span("dolor sit amet", styles=STYLE_EVERNOTE_BOLD)) actual = convert_div_excerpt(enml) expected = p("Lorem ipsum ", b("dolor sit amet")) self.assertEqual(actual, expected)
def test_convert_bold_phrase(self): enml = div("Lorem ipsum ", b("dolor sit amet")) actual = convert_div_excerpt(enml) expected = p("Lorem ipsum ", b("dolor sit amet")) self.assertEqual(actual, expected)
def test_convert_plain_phrase(self): actual = convert_div_excerpt(div("Lorem ipsum dolor sit amet")) expected = p("Lorem ipsum dolor sit amet") self.assertEqual(actual, expected)