Пример #1
0
 def testCreateModelWithEmptyInstanceIdArg(self):
   """
     Test for the empty dimension field in json.
   """
   data = utils.jsonEncode(self.modelsTestData["create_empty_instanceid_data"])
   response = self.app.put("/", data, status="*", headers=self.headers)
   assertions.assertInvalidArgumentsError(self, response, "json")
Пример #2
0
 def testCreateModelWithEmptyMetricArg(self):
   """
     Test for the missing empty metric field in json.
   """
   data = utils.jsonEncode(self.modelsTestData["create_empty_metric_data"])
   response = self.app.put("/", data, status="*", headers=self.headers)
   assertions.assertInvalidArgumentsError(self, response, "json")
Пример #3
0
 def testCreateModelWithInvalidRegionKey(self):
   """
     Test for the invalid region field in json.
   """
   data = utils.jsonEncode(self.modelsTestData["create_invalid_region_key"])
   response = self.app.put("/", data, status="*", headers=self.headers)
   assertions.assertInvalidArgumentsError(self, response, "json")
Пример #4
0
 def testCreateModelWithInvalidDatasourceArg(self):
   """
     Test for the invalid metric field in json.
   """
   data = utils.jsonEncode(self.modelsTestData["create_invalid_ds_data"])
   response = self.app.put("/", data, status="*", headers=self.headers)
   assertions.assertInvalidArgumentsError(self, response, "json")
Пример #5
0
 def testInvalidJsonModelsApi(self):
   """
     Test for the invalid json.
   """
   data = self.modelsTestData["create_data"]
   response = self.app.put("/", data, status="*", headers=self.headers)
   self.assertIn("No JSON object could be decoded", response.body)
   assertions.assertInvalidArgumentsError(self, response, "json")