Add test cases for execution attribute API endpoints.
@@ -1187,6 +1187,24 @@ class ActionExecutionControllerTestCase(BaseActionExecutionControllerTestCase, F
self.assertTrue('Invalid or unsupported exclude attribute specified:' in
resp.json['faultstring'])
+ def test_get_single_attribute_success(self):
+ exec_id = self.app.get('/v1/actionexecutions?limit=1').json[0]['id']
+
+ resp = self.app.get('/v1/executions/%s/attribute/result' % (exec_id))
+ self.assertEqual(resp.json, {})
+
+ resp = self.app.get('/v1/executions/%s/attribute/trigger_instance' % (exec_id))
+ self.assertEqual(resp.json, {})
+
+ def test_get_single_attribute_failure_invalud_attribute(self):
+ exec_id = self.app.get('/v1/actionexecutions?limit=1').json[0]['id']
+
+ resp = self.app.get('/v1/executions/%s/attribute/start_timestamp' % (exec_id),
+ expect_errors=True)
+ self.assertEqual(resp.status_int, 400)
+ self.assertTrue('Invalid attribute "start_timestamp" specified.' in
+ resp.json['faultstring'])
+
def _insert_mock_models(self):
execution_1_id = self._get_actionexecution_id(self._do_post(LIVE_ACTION_1))
execution_2_id = self._get_actionexecution_id(self._do_post(LIVE_ACTION_2))
