Exemple #1
0
 def _test_format_with_initial_null_lines(self):
     data = "\n\n\nFormat: %s" % self.url
     dlt_parser = Parser()
     data_parsed = dlt_parser.parse(data.splitlines(True))
     for paragraph in data_parsed:
         paragraph_content = paragraph["content"]
         self.assertEqual("header", paragraph["type"])
         for field in paragraph_content:
             field_content = field["content"]
             self.assertTrue("Format" in field_content)
             self.assertEqual(field_content["Format"][0].strip(), self.url)
             self.assertEqual("single_line_values", field["type"])
Exemple #2
0
 def _test_data_is_empty(self):
     data = ""
     dlt_parser = Parser()
     data_parsed = dlt_parser.parse(data)
     self.assertEqual(data_parsed, [])