def test_empty(self): assert dqi_parse_errors([]) == []
def test_mixed(self): valid = 'COORDINATE_REPROJECTION_FAILED' invalid = 'SOME_NON_GBIF_CODE' assert dqi_parse_errors([valid, invalid]) == [GBIF_ERRORS[valid]]
def test_all_match(self): names = list(GBIF_ERRORS.keys()) assert dqi_parse_errors(names) == list(GBIF_ERRORS.values())
def test_unmapped(self): # this is important because we want to avoid erroring if GBIF add new errors which we # haven't added to the extension yet name = 'SOME_NON_GBIF_CODE' assert dqi_parse_errors([name]) == []
def test_one_match(self): name = 'BASIS_OF_RECORD_INVALID' assert dqi_parse_errors([name]) == [GBIF_ERRORS[name]]