Beispiel #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")
Beispiel #2
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")
Beispiel #3
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")
Beispiel #4
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")
Beispiel #5
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")
Beispiel #6
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")
Beispiel #7
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")
Beispiel #8
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")
Beispiel #9
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")
Beispiel #10
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")