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