Skip to content

Commit db1a8cf

Browse files
committed
[validation] Remove Section repo present val
The Section repository present validation is no longer part of the default validation and should be added on demand.
1 parent 266f1c1 commit db1a8cf

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

odml/validation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ def section_type_must_be_defined(sec):
191191
Validation.register_handler('section', section_type_must_be_defined)
192192

193193

194+
# The Section repository present is no longer part of the default validation
195+
# and should be added on demand.
194196
def section_repository_present(sec):
195197
"""
196198
1. warn, if a section has no repository or
@@ -214,9 +216,6 @@ def section_repository_present(sec):
214216
yield ValidationError(sec, msg, LABEL_WARNING)
215217

216218

217-
Validation.register_handler('section', section_repository_present)
218-
219-
220219
def document_unique_ids(doc):
221220
"""
222221
Traverse an odML Document and check whether all

test/test_validation.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -195,21 +195,6 @@ def test_section_sections_cardinality(self):
195195

196196
self.assertTrue(found)
197197

198-
def test_section_in_terminology(self):
199-
doc = samplefile.parse("""s1[T1]""")
200-
res = Validate(doc)
201-
self.assertError(res, "A section should have an associated repository",
202-
filter_rep=False)
203-
204-
odml.terminology.terminologies['map'] = samplefile.parse("""
205-
s0[t0]
206-
- S1[T1]
207-
""")
208-
doc.sections[0].repository = 'map'
209-
res = Validate(doc)
210-
# self.assertEqual(list(self.filter_mapping_errors(res.errors)), [])
211-
self.assertEqual(res.errors, [])
212-
213198
def test_uniques(self):
214199
self.assertRaises(KeyError, samplefile.parse, """
215200
s1[t1]

0 commit comments

Comments
 (0)