コード例 #1
0
ファイル: load.py プロジェクト: nicholasw-gc/hemelb
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
コード例 #2
0
ファイル: load.py プロジェクト: UCL/hemelb
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
コード例 #3
0
 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'))
コード例 #4
0
    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'))