コード例 #1
0
 def test_schema_validate(self):
     s = Schema(**SCHEMA_1)
     # Duplicate unique attribute 'name'
     m = [{
         'type': 'listener',
         'name': 'x'
     }, {
         'type': 'listener',
         'name': 'x'
     }]
     self.assertRaises(ValidationError, s.validate_all, m)
     # Duplicate singleton entity 'container'
     m = [{
         'type': 'container',
         'name': 'x'
     }, {
         'type': 'container',
         'name': 'y'
     }]
     self.assertRaises(ValidationError, s.validate_all, m)
     # Valid model
     m = [{
         'type': 'container',
         'name': 'x'
     }, {
         'type': 'listener',
         'name': 'y'
     }]
     s.validate_all(m)
コード例 #2
0
ファイル: schema.py プロジェクト: ChugR/qpid-dispatch
 def test_schema_validate(self):
     s = Schema(**SCHEMA_1)
     # Duplicate unique attribute 'name'
     m = [{"type": "listener", "name": "x"}, {"type": "listener", "name": "x"}]
     self.assertRaises(ValidationError, s.validate_all, m)
     # Duplicate singleton entity 'container'
     m = [{"type": "container", "name": "x"}, {"type": "container", "name": "y"}]
     self.assertRaises(ValidationError, s.validate_all, m)
     # Valid model
     m = [{"type": "container", "name": "x"}, {"type": "listener", "name": "y"}]
     s.validate_all(m)
コード例 #3
0
ファイル: schema.py プロジェクト: eric2a/qpid-dispatch
 def test_schema_validate(self):
     s = Schema(**SCHEMA_1)
     # Duplicate unique attribute 'name'
     m = [{'type': 'listener', 'name':'x'},
          {'type': 'listener', 'name':'x'}]
     self.assertRaises(ValidationError, s.validate_all, m)
     # Duplicate singleton entity 'container'
     m = [{'type': 'container', 'name':'x'},
          {'type': 'container', 'name':'y'}]
     self.assertRaises(ValidationError, s.validate_all, m)
     # Valid model
     m = [{'type': 'container', 'name':'x'},
          {'type': 'listener', 'name':'y'}]
     s.validate_all(m)