Ejemplo n.º 1
0
 def test_array_every_item_type(self):
     """Checks if array entries match schema"""
     for schema_name, expected_type in schema_to_array_items_type.items():
         schema = self.schema
         schema['items'] = docsmodel.get_schema_from_file('test_schemas/' +
                                                          schema_name +
                                                          '.json')
         parsed_items = self.docs_model.parse(schema)
         self.assertTrue(expected_type == parsed_items[1]['type'])
Ejemplo n.º 2
0
 def test_exactly_one_entry_is_generated(self):
     """Test if one entry is generated"""
     for schema_name, expected_number in basic_type_schemas_PI_count.items(
     ):
         schema = self.schema
         schema['items'] = docsmodel.get_schema_from_file('test_schemas/' +
                                                          schema_name +
                                                          '.json')
         parsed_items = self.docs_model.parse(schema)
         self.assertTrue(
             expected_number == len(parsed_items),
             'For {} expected {} parsed items, got {}'.format(
                 schema_name, expected_number, len(parsed_items)))
Ejemplo n.º 3
0
 def setUp(self):
     self.dm = docsmodel.DocsModel()
     self.schema = docsmodel.get_schema_from_file(
         'test_schemas/simple_object.json')
     self.parsed_items = self.dm.parse(self.schema)
Ejemplo n.º 4
0
 def setUp(self):
     """Tests set up."""
     self.docs_model = docsmodel.DocsModel()
     self.schema = docsmodel.get_schema_from_file('test_schemas/enum.json')
Ejemplo n.º 5
0
 def setUp(self):
     self.docs_model = docsmodel.DocsModel()
     self.schema = docsmodel.get_schema_from_file(
         'test_schemas/array_list.json')
Ejemplo n.º 6
0
 def setUp(self):
     self.docs_model = docsmodel.DocsModel()
     self.schema = docsmodel.get_schema_from_file(
         'test_schemas/string_defaults.json')
     self.parsed_items = self.docs_model.parse(self.schema)
Ejemplo n.º 7
0
 def setUp(self):
     self.dm = docsmodel.DocsModel()
     self.schema = docsmodel.get_schema_from_file(
         'test_schemas/number_defaults.json')
     self.parsed_items = self.dm.parse(self.schema)