@@ -451,7 +451,7 @@ def test_get_one_max_result_size_query_parameter(self):
451451
452452 # Update it with the result (this populates result and result size attributes)
453453 data = {
454- "result" : {"fooo" : "a" * 1000 },
454+ "result" : {"stdout" : { " fooo" : "a" * 1000 }, "succeeded" : True , "failed" : False , "stderr" : "" },
455455 "status" : "succeeded" ,
456456 }
457457 actual_result_size = len (json_encode (data ["result" ]))
@@ -1281,16 +1281,16 @@ def test_put_status_and_result(self):
12811281 self .assertEqual (post_resp .status_int , 201 )
12821282
12831283 execution_id = self ._get_actionexecution_id (post_resp )
1284- updates = {"status" : "succeeded" , "result" : {"stdout" : "foobar" }}
1284+ updates = {"status" : "succeeded" , "result" : {"stdout" : "foobar" , "succeeded" : True , "failed" : False , "stderr" : "" }}
12851285 put_resp = self ._do_put (execution_id , updates )
12861286 self .assertEqual (put_resp .status_int , 200 )
12871287 self .assertEqual (put_resp .json ["status" ], "succeeded" )
1288- self .assertDictEqual (put_resp .json ["result" ], {"stdout" : "foobar" })
1288+ self .assertDictEqual (put_resp .json ["result" ], {"stdout" : "foobar" , "succeeded" : True , "failed" : False , "stderr" : "" })
12891289
12901290 get_resp = self ._do_get_one (execution_id )
12911291 self .assertEqual (get_resp .status_int , 200 )
12921292 self .assertEqual (get_resp .json ["status" ], "succeeded" )
1293- self .assertDictEqual (get_resp .json ["result" ], {"stdout" : "foobar" })
1293+ self .assertDictEqual (get_resp .json ["result" ], {"stdout" : "foobar" , "succeeded" : True , "failed" : False , "stderr" : "" })
12941294
12951295 def test_put_bad_state (self ):
12961296 post_resp = self ._do_post (LIVE_ACTION_1 )
@@ -1329,11 +1329,11 @@ def test_put_status_to_completed_execution(self):
13291329 self .assertEqual (post_resp .status_int , 201 )
13301330
13311331 execution_id = self ._get_actionexecution_id (post_resp )
1332- updates = {"status" : "succeeded" , "result" : {"stdout" : "foobar" }}
1332+ updates = {"status" : "succeeded" , "result" : {"stdout" : "foobar" , "succeeded" : True , "failed" : False , "stderr" : "" }}
13331333 put_resp = self ._do_put (execution_id , updates )
13341334 self .assertEqual (put_resp .status_int , 200 )
13351335 self .assertEqual (put_resp .json ["status" ], "succeeded" )
1336- self .assertDictEqual (put_resp .json ["result" ], {"stdout" : "foobar" })
1336+ self .assertDictEqual (put_resp .json ["result" ], {"stdout" : "foobar" , "succeeded" : True , "failed" : False , "stderr" : "" })
13371337
13381338 updates = {"status" : "abandoned" }
13391339 put_resp = self ._do_put (execution_id , updates , expect_errors = True )
@@ -1345,7 +1345,7 @@ def test_put_execution_missing_liveaction(self):
13451345 self .assertEqual (post_resp .status_int , 201 )
13461346
13471347 execution_id = self ._get_actionexecution_id (post_resp )
1348- updates = {"status" : "succeeded" , "result" : {"stdout" : "foobar" }}
1348+ updates = {"status" : "succeeded" , "result" : {"stdout" : "foobar" , "succeeded" : True , "failed" : False , "stderr" : "" }}
13491349 put_resp = self ._do_put (execution_id , updates , expect_errors = True )
13501350 self .assertEqual (put_resp .status_int , 500 )
13511351
@@ -1612,22 +1612,22 @@ def test_get_raw_result(self):
16121612 execution_id = self ._get_actionexecution_id (get_resp )
16131613 updates = {
16141614 "status" : "succeeded" ,
1615- "result" : {"stdout" : "foobar" , "stderr" : "barfoo" },
1615+ "result" : {"stdout" : "foobar" , "stderr" : "barfoo" , "succeeded" : True , "failed" : False },
16161616 }
16171617 put_resp = self ._do_put (execution_id , updates )
16181618 self .assertEqual (put_resp .status_int , 200 )
16191619 self .assertEqual (put_resp .json ["status" ], "succeeded" )
16201620 self .assertDictEqual (
1621- put_resp .json ["result" ], {"stdout" : "foobar" , "stderr" : "barfoo" }
1621+ put_resp .json ["result" ], {"stdout" : "foobar" , "stderr" : "barfoo" , "succeeded" : True , "failed" : False }
16221622 )
16231623 self .assertEqual (
1624- put_resp .json ["result_size" ], len ('{"stdout":"foobar","stderr":"barfoo"}' )
1624+ put_resp .json ["result_size" ], len ('{"stdout":"foobar","stderr":"barfoo","succeeded":true,"failed":false }' )
16251625 )
16261626
16271627 # 1. download=False, compress=False, pretty_format=False
16281628 get_resp = self .app .get ("/v1/executions/%s/result" % (execution_id ))
16291629 self .assertEqual (get_resp .headers ["Content-Type" ], "text/json" )
1630- self .assertEqual (get_resp .body , b'{"stdout":"foobar","stderr":"barfoo"}' )
1630+ self .assertEqual (get_resp .body , b'{"stdout":"foobar","stderr":"barfoo","succeeded":true,"failed":false }' )
16311631
16321632 # 2. download=False, compress=False, pretty_format=True
16331633 get_resp = self .app .get (
@@ -1636,7 +1636,9 @@ def test_get_raw_result(self):
16361636 expected_result = b"""
16371637{
16381638 "stdout": "foobar",
1639- "stderr": "barfoo"
1639+ "stderr": "barfoo",
1640+ "succeeded": true,
1641+ "failed": false
16401642}""" .strip ()
16411643 self .assertEqual (get_resp .headers ["Content-Type" ], "text/json" )
16421644 self .assertEqual (get_resp .body , expected_result )
@@ -1645,7 +1647,7 @@ def test_get_raw_result(self):
16451647 # NOTE: webtest auto decompresses the result
16461648 get_resp = self .app .get ("/v1/executions/%s/result?compress=1" % (execution_id ))
16471649 self .assertEqual (get_resp .headers ["Content-Type" ], "application/x-gzip" )
1648- self .assertEqual (get_resp .body , b'{"stdout":"foobar","stderr":"barfoo"}' )
1650+ self .assertEqual (get_resp .body , b'{"stdout":"foobar","stderr":"barfoo","succeeded":true,"failed":false }' )
16491651
16501652 # 4. download=True, compress=False, pretty_format=False
16511653 get_resp = self .app .get ("/v1/executions/%s/result?download=1" % (execution_id ))
@@ -1654,7 +1656,7 @@ def test_get_raw_result(self):
16541656 get_resp .headers ["Content-Disposition" ],
16551657 "attachment; filename=execution_%s_result.json" % (execution_id ),
16561658 )
1657- self .assertEqual (get_resp .body , b'{"stdout":"foobar","stderr":"barfoo"}' )
1659+ self .assertEqual (get_resp .body , b'{"stdout":"foobar","stderr":"barfoo","succeeded":true,"failed":false }' )
16581660
16591661 # 5. download=True, compress=False, pretty_format=True
16601662 get_resp = self .app .get (
@@ -1663,7 +1665,9 @@ def test_get_raw_result(self):
16631665 expected_result = b"""
16641666{
16651667 "stdout": "foobar",
1666- "stderr": "barfoo"
1668+ "stderr": "barfoo",
1669+ "succeeded": true,
1670+ "failed": false
16671671}""" .strip ()
16681672
16691673 self .assertEqual (get_resp .headers ["Content-Type" ], "text/json" )
@@ -1681,7 +1685,9 @@ def test_get_raw_result(self):
16811685 expected_result = b"""
16821686{
16831687 "stdout": "foobar",
1684- "stderr": "barfoo"
1688+ "stderr": "barfoo",
1689+ "succeeded": true,
1690+ "failed": false
16851691}""" .strip ()
16861692
16871693 self .assertEqual (get_resp .headers ["Content-Type" ], "application/x-gzip" )
@@ -1774,7 +1780,7 @@ def test_get_single_attribute_success(self):
17741780
17751781 data = {}
17761782 data ["status" ] = action_constants .LIVEACTION_STATUS_SUCCEEDED
1777- data ["result" ] = {"foo" : "bar" }
1783+ data ["result" ] = {"foo" : "bar" , "stdout" : "hello world" , "stderr" : "" , "succeeded" : True , "failed" : False }
17781784
17791785 resp = self .app .put_json ("/v1/executions/%s" % (exec_id ), data )
17801786 self .assertEqual (resp .status_int , 200 )
0 commit comments