def temporary_profile(tmpdir, name): result = Profile() basename = tmpdir.join(name).strpath outGmyFileName = basename + '.gmy' outXmlFileName = basename + '.xml' result.OutputGeometryFile = outGmyFileName result.OutputXmlFile = outXmlFileName return result
def test_regression(self, tmpdir): """Generate a gmy from a stored profile and check that the output is identical. """ dataDir = os.path.join(os.path.split(__file__)[0], 'data') proFileName = os.path.join(dataDir, 'test.pro') p = Profile() p.LoadFromFile(proFileName) # Change the output to the tmpdir basename = tmpdir.join('test').strpath outGmyFileName = basename + '.gmy' outXmlFileName = basename + '.xml' p.OutputGeometryFile = outGmyFileName p.OutputXmlFile = outXmlFileName generator = OutputGeneration.PolyDataGenerator(p) generator.Execute() import filecmp assert filecmp.cmp(outGmyFileName, os.path.join(dataDir, 'test.gmy')) assert filecmp.cmp(outXmlFileName, os.path.join(dataDir, 'test.xml'))