コード例 #1
0
 def test_read_property(self):
     schema = jsch.Schema(max_properties=6)
     self.assertEqual(6, schema.max_properties)
コード例 #2
0
 def test_read_unassigned_property(self):
     schema = jsch.Schema()
     self.assertIsNone(schema.type)
コード例 #3
0
 def test_read_property(self):
     schema = jsch.Schema(unique_items=True)
     self.assertEqual(True, schema.unique_items)
コード例 #4
0
 def test_read_property(self):
     schema = jsch.Schema(required=['name', 'age'])
     self.assertEqual(['name', 'age'], schema.required)
コード例 #5
0
 def test_read_property(self):
     schema = jsch.Schema(title='jsch')
     self.assertEqual('jsch', schema.title)
コード例 #6
0
 def test_set_property(self):
     schema = jsch.Schema()
     message = "can't set keyword attribute"
     with self.assertRaisesAttributeError(message):
         schema.properties = {'name': jsch.Schema()}
コード例 #7
0
 def test_read_property(self):
     schema = jsch.Schema(ref='#/definitions/person')
     self.assertEqual('#/definitions/person', schema.ref)
コード例 #8
0
 def test_read_unassigned_property(self):
     schema = jsch.Schema()
     self.assertIsNone(schema.additional_properties)
コード例 #9
0
 def test_read_property(self):
     schema = jsch.Schema(minimum=6.2)
     self.assertEqual(6.2, schema.minimum)
コード例 #10
0
 def test_read_property(self):
     schema = jsch.Schema(min_length=2)
     self.assertEqual(2, schema.min_length)
コード例 #11
0
 def test_read_property(self):
     schema = jsch.Schema(min_properties=4)
     self.assertEqual(4, schema.min_properties)
コード例 #12
0
 def test_read_property(self):
     schema = jsch.Schema(min_items=3)
     self.assertEqual(3, schema.min_items)
コード例 #13
0
 def test_read_property(self):
     schema = jsch.Schema(additional_properties=True)
     self.assertEqual(True, schema.additional_properties)
コード例 #14
0
 def test_read_property(self):
     schema = jsch.Schema(maximum=8.9)
     self.assertEqual(8.9, schema.maximum)
コード例 #15
0
 def test_read_unassigned_property(self):
     schema = jsch.Schema()
     self.assertIsNone(schema.pattern_properties)
コード例 #16
0
 def test_read_property(self):
     schema = jsch.Schema(multiple_of=4.7)
     self.assertEqual(4.7, schema.multiple_of)
コード例 #17
0
 def test_read_property(self):
     schema = jsch.Schema(properties={'name': jsch.Schema()})
     self.assertEqual({'name': jsch.Schema()}, schema.properties)
コード例 #18
0
 def test_set_property(self):
     schema = jsch.Schema()
     message = "can't set keyword attribute"
     with self.assertRaisesAttributeError(message):
         schema.multiple_of = 4.7
コード例 #19
0
 def test_read_property(self):
     schema = jsch.Schema(all_of=[jsch.Schema()])
     self.assertEqual([jsch.Schema()], schema.all_of)
コード例 #20
0
 def test_set_property(self):
     schema = jsch.Schema()
     message = "can't set keyword attribute"
     with self.assertRaisesAttributeError(message):
         schema.additional_properties = True
コード例 #21
0
 def test_set_property(self):
     schema = jsch.Schema()
     message = "can't set keyword attribute"
     with self.assertRaisesAttributeError(message):
         schema.ref = '#/definitions/person'
コード例 #22
0
 def test_read_property(self):
     schema = jsch.Schema(not_=jsch.Schema())
     self.assertEqual(jsch.Schema(), schema.not_)
コード例 #23
0
 def test_set_property(self):
     schema = jsch.Schema()
     message = "can't set keyword attribute"
     with self.assertRaisesAttributeError(message):
         schema.required = ['name', 'age']
コード例 #24
0
 def test_read_property(self):
     schema = jsch.Schema(pattern='[0-9A-Z]')
     self.assertEqual('[0-9A-Z]', schema.pattern)
コード例 #25
0
 def test_read_property(self):
     schema = jsch.Schema(type='string')
     self.assertEqual('string', schema.type)
コード例 #26
0
 def test_set_property(self):
     schema = jsch.Schema()
     message = "can't set keyword attribute"
     with self.assertRaisesAttributeError(message):
         schema.pattern = '[0-9A-Z]'
コード例 #27
0
 def test_set_property(self):
     schema = jsch.Schema()
     message = "can't set keyword attribute"
     with self.assertRaisesAttributeError(message):
         schema.type = 'string'
コード例 #28
0
 def test_read_property(self):
     schema = jsch.Schema(pattern_properties={'[0-9]': jsch.Schema()})
     self.assertEqual({'[0-9]': jsch.Schema()}, schema.pattern_properties)
コード例 #29
0
 def test_read_unassigned_property(self):
     schema = jsch.Schema()
     self.assertIsNone(schema.unique_items)
コード例 #30
0
 def test_read_property(self):
     schema = jsch.Schema(items=jsch.Schema())
     self.assertEqual(jsch.Schema(), schema.items)