def test_meta_tag(self): source = ''' <meta field1="value1" field3=" - li1 - li2 " field4=" subfield1: subvalue subfield2: true "> </meta> Header content # First caption content ''' expected = ''' <meta field1="value1" field3=" - li1 - li2 " field4=" subfield1: subvalue subfield2: true "> </meta> Header content ''' self.assertEqual(get_header_content(source), expected)
def test_only_yfm(self): source = '''--- field1: value1 #field2: 2 field3: - li1 - li2 field4: subfield1: subvalue subfield2: true --- # First caption content ''' expected = '''--- field1: value1 #field2: 2 field3: - li1 - li2 field4: subfield1: subvalue subfield2: true --- ''' self.assertEqual(get_header_content(source), expected)
def test_no_headings(self): source = 'line1\n\nline2\n\nline3\n\nline4\n\nline5\n\nline6\n\n' self.assertEqual(get_header_content(source), source)
def test_no_header(self): source = '# First caption right away\n\Lorem ipsum dolor sit amet.' self.assertEqual(get_header_content(source), '')