# Path: caravan/tests/util.py
# def mock_args(args):
#     return mock.patch('sys.argv', ['PROG'] + args)
# 
# Path: caravan/commands/terminate.py
# class Command(BaseCommand):
# 
#     description = 'Terminate a workflow execution'
# 
#     def setup_arguments(self, parser):
#         parser.add_argument('-d', '--domain', required=True)
#         parser.add_argument('-i', '--id', required=True)
#         parser.add_argument('--run-id')
#         parser.add_argument('--reason')
#         parser.add_argument('--details')
#         parser.add_argument('--child-policy', choices=self.CHILD_POLICIES)
# 
#     def run(self):
#         run_swf_command(
#             'terminate_workflow_execution',
#             domain=self.args.domain,
#             workflowId=self.args.id,
#             runId=self.args.run_id,
#             reason=self.args.reason,
#             details=self.args.details,
#             childPolicy=self.args.child_policy,
#             )
#         return 'Execution terminated.'


import unittest
import json
import httpretty
from abduct import captured, out, err
from caravan.tests.util import mock_args
from caravan.commands.terminate import Command
        self.assertEqual(json.loads(request.parsed_body), expected)

    @httpretty.activate
    def test_parameter_reason(self):
        httpretty_register()
        run_command(['--reason', 'REASON'])
        request = httpretty.last_request()

        expected = {
            "domain": "DOMAIN",
            "reason": 'REASON',
            "workflowId": "ID",
            }
        self.assertEqual(json.loads(request.parsed_body), expected)

    @httpretty.activate
    def test_parameter_details(self):
        httpretty_register()
        run_command(['--details', 'DETAILS'])
        request = httpretty.last_request()

        expected = {
            "domain": "DOMAIN",
            "details": 'DETAILS',
            "workflowId": "ID",
            }
        self.assertEqual(json.loads(request.parsed_body), expected)

    @httpretty.activate
    def test_parameter_child_policy(self):

# Path: caravan/tests/util.py
# def mock_args(args):
#     return mock.patch('sys.argv', ['PROG'] + args)
# 
# Path: caravan/commands/terminate.py
# class Command(BaseCommand):
# 
#     description = 'Terminate a workflow execution'
# 
#     def setup_arguments(self, parser):
#         parser.add_argument('-d', '--domain', required=True)
#         parser.add_argument('-i', '--id', required=True)
#         parser.add_argument('--run-id')
#         parser.add_argument('--reason')
#         parser.add_argument('--details')
#         parser.add_argument('--child-policy', choices=self.CHILD_POLICIES)
# 
#     def run(self):
#         run_swf_command(
#             'terminate_workflow_execution',
#             domain=self.args.domain,
#             workflowId=self.args.id,
#             runId=self.args.run_id,
#             reason=self.args.reason,
#             details=self.args.details,
#             childPolicy=self.args.child_policy,
#             )
#         return 'Execution terminated.'


# Path: caravan/tests/commands/test_terminate.py
import unittest
import json
import httpretty
from abduct import captured, out, err
from caravan.tests.util import mock_args
from caravan.commands.terminate import Command

        self.assertEqual(json.loads(request.parsed_body), expected)

    @httpretty.activate
    def test_parameter_reason(self):
        httpretty_register()
        run_command(['--reason', 'REASON'])
        request = httpretty.last_request()

        expected = {
            "domain": "DOMAIN",
            "reason": 'REASON',
            "workflowId": "ID",
            }
        self.assertEqual(json.loads(request.parsed_body), expected)

    @httpretty.activate
    def test_parameter_details(self):
        httpretty_register()
        run_command(['--details', 'DETAILS'])
        request = httpretty.last_request()

        expected = {
            "domain": "DOMAIN",
            "details": 'DETAILS',
            "workflowId": "ID",
            }
        self.assertEqual(json.loads(request.parsed_body), expected)

    @httpretty.activate
    def test_parameter_child_policy(self):

        test_policy = Command.CHILD_POLICIES[0]