from dqc_wrapper.test04_spatial_consistency import SpatialConsistencyTest
from dqc_wrapper.unit_tests.conftest import dirs


def test_main():
    # Netcdf test
    test = SpatialConsistencyTest([dirs.nc_file], 'generic', '1.125', '', '')
    response = test.main()
    assert response['res'] == 'ok'

    # # Spatial inconsistencies
    test = SpatialConsistencyTest([dirs.nc_file], 'generic', '123', '', '')
    response = test.main()
    assert (response['res'] == 'err' and
            'spatial inconsistencies' in response['msg'].lower())
