From 961147a3c99b4d0cee6bc2aa16bccc20d9b77b27 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Mon, 8 Feb 2021 00:58:17 +0100 Subject: [PATCH] Fix EC Code resolution --- src/bioregistry/data/bioregistry.json | 1 + tests/test_data.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/bioregistry/data/bioregistry.json b/src/bioregistry/data/bioregistry.json index 80e52f7c9..f2e32919f 100644 --- a/src/bioregistry/data/bioregistry.json +++ b/src/bioregistry/data/bioregistry.json @@ -4558,6 +4558,7 @@ "prefix": "ec-code" }, "name": "Enzyme Nomenclature", + "pattern": "^\\d{1,2}(\\.\\d{0,2}){0,3}$", "synonyms": [ "EC", "EC-CODE", diff --git a/tests/test_data.py b/tests/test_data.py index 056f6b947..135899162 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -55,6 +55,10 @@ def test_patterns(self): if external_pattern: self.assertEqual(pattern, external_pattern, msg=f'{prefix}: {key} pattern not same') + for eccode in ['1', '1.1', '1.1.1', '1.1.1.1']: + with self.subTest(eccode=eccode): + self.assertTrue(bioregistry.validate('eccode', eccode)) + def test_examples(self): """Test that all entries have examples.""" for prefix, entry in self.registry.items():