Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 6
0
 def testCreateModelWithEmptyRegionArg(self):
     """
   Test for the missing empty datasource field in json.
 """
     data = utils.jsonEncode(self.modelsTestData["create_empty_region"])
     response = self.app.put("/", data, status="*", headers=self.headers)
     assertions.assertInvalidArgumentsError(self, response, "json")
Exemplo n.º 7
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")
Exemplo n.º 8
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")
Exemplo n.º 9
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")
Exemplo n.º 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")