Exemplo n.º 1
0
def test_writer_control_file(mg):
    with tempfile.TemporaryDirectory() as result_path:
        writer = gefdc.GEFDCWriter(mg, result_path)
        known_filename = resource_filename('pygridtools.tests.baseline_files',
                                           'modelgrid_gefdc.inp')
        result_file = 'modelgrid_gefdc.inp'
        writer.control_file(filename=result_file, title='Model Grid Test')
        utils.assert_textfiles_equal(known_filename,
                                     os.path.join(result_path, result_file))
Exemplo n.º 2
0
def test_writer_gridout_file(mg):
    with tempfile.TemporaryDirectory() as result_path:
        writer = gefdc.GEFDCWriter(mg, result_path)
        known_filename = resource_filename('pygridtools.tests.baseline_files', 'modelgrid_grid.out')
        result_file = 'modelgrid_grid.out'
        writer.gridout_file(filename=result_file)
        utils.assert_textfiles_equal(
            known_filename,
            os.path.join(result_path, result_file),
        )