예제 #1
0
 def test_list_schemas(self):
     """ Testing GET /api/2.0/schemas """
     api20().schemas_get()
     schemas = self.__get_data()
     LOG.debug(schemas,json=True)
     assert_not_equal(0, len(schemas), message='Schema list was empty')
     self.__schemaList = schemas
예제 #2
0
 def test_list_schemas(self):
     # """ Testing GET /api/2.0/schemas """
     api20().schemas_get()
     schemas = self.__get_data()
     logs.debug(dumps(schemas, indent=4))
     self.assertNotEqual(0, len(schemas), msg='Schema list was empty')
     self.__class__.__schemaList = schemas
예제 #3
0
 def test_list_schemas(self):
     """ Testing GET /api/2.0/schemas """
     api20().schemas_get()
     schemas = self.__get_data()
     LOG.debug(schemas, json=True)
     assert_not_equal(0, len(schemas), message="Schema list was empty")
     self.__schemaList = schemas
예제 #4
0
 def test_get_schema_invalid(self):
     # """ Testing GET /api/2.0/schemas/{identifier} 404s properly """
     self.assertIsNotNone(self.__class__.__schemaList)
     for member in self.__class__.__schemaList:
         self.assertIsNotNone(member)
         try:
             api20().schemas_id_get(member + '-invalid')
             self.fail(msg='did not raise exception')
         except rest.ApiException as e:
             self.assertEqual(404, e.status, msg='unexpected response {0}, expected 404'.format(e.status))
         break
예제 #5
0
 def test_get_schema(self):
     # """ Testing GET /api/2.0/schemas/{identifier} """
     self.assertIsNotNone(self.__class__.__schemaList)
     for member in self.__class__.__schemaList:
         self.assertIsNotNone(member)
         dataId = member.split('/api/2.0/schemas/')[1]
         api20().schemas_id_get(dataId)
         schema_ref = self.__get_data()
         logs.debug(dumps(schema_ref, indent=4))
         self.assertIn('title', schema_ref.keys(), msg='title not found in schema')
         self.assertIn('definitions', schema_ref.keys(), msg='definitions not found in schema')
예제 #6
0
 def test_get_schema_invalid(self):
     """ Testing GET /api/2.0/schemas/{identifier} 404s properly """
     assert_not_equal(None, self.__schemaList)
     for member in self.__schemaList:
         assert_not_equal(None,member)
         try:
             api20().schemas_id_get(member + '-invalid')
             fail(message='did not raise exception')
         except rest.ApiException as e:
             assert_equal(404, e.status, message='unexpected response {0}, expected 404'.format(e.status))
         break
예제 #7
0
 def test_get_schema_invalid(self):
     """ Testing GET /api/2.0/schemas/{identifier} 404s properly """
     assert_not_equal(None, self.__schemaList)
     for member in self.__schemaList:
         assert_not_equal(None, member)
         try:
             api20().schemas_id_get(member + "-invalid")
             fail(message="did not raise exception")
         except rest.ApiException as e:
             assert_equal(404, e.status, message="unexpected response {0}, expected 404".format(e.status))
         break
예제 #8
0
 def test_get_schema(self):
     """ Testing GET /api/2.0/schemas/{identifier} """
     assert_not_equal(None, self.__schemaList)
     for member in self.__schemaList:
         assert_not_equal(None,member)
         dataId = member.split('/api/2.0/schemas/')[1]
         api20().schemas_id_get(dataId)
         schema_ref = self.__get_data()
         LOG.debug(schema_ref,json=True)
         id = schema_ref.get('title')
         assert_true('title' in schema_ref.keys(), message='title not found in schema')
         assert_true('definitions' in schema_ref.keys(), message='definitions not found in schema')
예제 #9
0
 def test_get_schema(self):
     """ Testing GET /api/2.0/schemas/{identifier} """
     assert_not_equal(None, self.__schemaList)
     for member in self.__schemaList:
         assert_not_equal(None, member)
         dataId = member.split("/api/2.0/schemas/")[1]
         api20().schemas_id_get(dataId)
         schema_ref = self.__get_data()
         LOG.debug(schema_ref, json=True)
         id = schema_ref.get("title")
         assert_true("title" in schema_ref.keys(), message="title not found in schema")
         assert_true("definitions" in schema_ref.keys(), message="definitions not found in schema")