Example #1
0
 def test_is_not_document_type_container_if_missing_document_trait(self):
     self.shapes['NonDocStructure'] = {
         'type': 'structure',
         'members': {},
     }
     self.assertFalse(
         is_document_type_container(
             self.get_shape_model('NonDocStructure')))
Example #2
0
 def test_is_document_type_container_if_list_member(self):
     self.shapes['ListOfDocTypes'] = {
         'type': 'list',
         'member': {'shape': 'DocType'}
     }
     self.shapes['DocType'] = self.get_doc_type_shape_definition()
     self.assertTrue(
         is_document_type_container(self.get_shape_model('ListOfDocTypes'))
     )
Example #3
0
 def test_is_document_type_container_if_map_value(self):
     self.shapes['MapOfDocTypes'] = {
         'type': 'map',
         'key': {'shape': 'String'},
         'value': {'shape': 'DocType'}
     }
     self.shapes['DocType'] = self.get_doc_type_shape_definition()
     self.shapes['String'] = {'type': 'string'}
     self.assertTrue(
         is_document_type_container(self.get_shape_model('MapOfDocTypes'))
     )
Example #4
0
 def test_is_not_document_type_container_if_not_scalar(self):
     self.shapes['String'] = {'type': 'string'}
     self.assertFalse(
         is_document_type_container(self.get_shape_model('String')))
Example #5
0
 def test_is_document_type_container_for_doc_type(self):
     self.shapes['DocStructure'] = self.get_doc_type_shape_definition()
     self.assertTrue(
         is_document_type_container(self.get_shape_model('DocStructure')))