Пример #1
0
 def test_empty(self):
     assert dqi_parse_errors([]) == []
Пример #2
0
 def test_mixed(self):
     valid = 'COORDINATE_REPROJECTION_FAILED'
     invalid = 'SOME_NON_GBIF_CODE'
     assert dqi_parse_errors([valid, invalid]) == [GBIF_ERRORS[valid]]
Пример #3
0
 def test_all_match(self):
     names = list(GBIF_ERRORS.keys())
     assert dqi_parse_errors(names) == list(GBIF_ERRORS.values())
Пример #4
0
 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]) == []
Пример #5
0
 def test_one_match(self):
     name = 'BASIS_OF_RECORD_INVALID'
     assert dqi_parse_errors([name]) == [GBIF_ERRORS[name]]