示例#1
0
 async def test_xml_tar_gz(self):
     with TemporaryDirectory() as output_directory_path:
         configuration = Configuration(output_directory_path,
                                       'https://example.com')
         async with Site(configuration) as site:
             gramps_file_path = join(dirname(abspath(__file__)), 'assets',
                                     'minimal.gpkg')
             parse_xml(site, gramps_file_path)
示例#2
0
 async def _parse(self, xml: str) -> Ancestry:
     with TemporaryDirectory() as output_directory_path:
         configuration = Configuration(output_directory_path,
                                       'https://example.com')
         async with Site(configuration) as site:
             with NamedTemporaryFile(mode='r+') as f:
                 f.write(xml.strip())
                 f.seek(0)
                 parse_xml(site, f.name)
                 return site.ancestry
示例#3
0
 async def setUpClass(cls) -> None:
     # @todo Convert each test method to use self._parse(), so we can remove this shared XML file.
     with TemporaryDirectory() as output_directory_path:
         configuration = Configuration(output_directory_path,
                                       'https://example.com')
         async with Site(configuration) as site:
             cls.ancestry = site.ancestry
             parse_xml(
                 site, join(dirname(abspath(__file__)), 'assets',
                            'data.xml'))