Skip to content
Snippets Groups Projects
Select Git revision
  • 5a9361798ba9a9028104fd324e4e15371fa12855
  • main default protected
2 results

parser-cli.cpp

Blame
  • tests.py 705 B
    import inmplot
    
    import pytest
    import filecmp
    import os
    
    
    @pytest.fixture
    def convert_ctl_to_netcdf():
      inmplot.ctl_to_netcdf(os.path.join('tests','data','mmsst.ctl'), 'test.nc')
      yield
      os.remove('test.nc')
    
    def test_ctl_to_netcdf(convert_ctl_to_netcdf):
      assert filecmp.cmp('test.nc', os.path.join('tests','data','mmsst.nc')) 
    
    
    
    
    
    def teardown_module():
      os.remove('test.png')
    
    @pytest.mark.mpl_image_compare(baseline_dir="data", filename='sst.png', savefig_kwargs={'dpi': 100})
    def test_plot_ctl():
      return inmplot.plot_ctl(
          ctl_file=os.path.join('tests','data','mmsst.ctl'),
          varname='sst',
          tnum=0,
          znum=0,
          cmap='coolwarm',
          out_file="test.png",
          dpi=100)