# Path: caravan/tests/util.py
# def mock_args(args):
#     return mock.patch('sys.argv', ['PROG'] + args)
# 
# Path: caravan/commands/domain_list.py
# class Command(BaseCommand):
# 
#     description = 'List domains'
# 
#     def setup_arguments(self, parser):
#         parser.add_argument('--deprecated',
#                             dest='registration_status',
#                             action='store_const',
#                             const='DEPRECATED',
#                             default='REGISTERED')
# 
#     def run(self):
#         response = run_swf_command(
#             'list_domains',
#             registrationStatus=self.args.registration_status
#             )
# 
#         return response['domainInfos']


import unittest
import json
import httpretty
from abduct import captured, out, err
from caravan.tests.util import mock_args
from caravan.commands.domain_list import Command




def httpretty_register():
    headers = {
        'x-amzn-RequestId': 'd68969c7-3f0d-11e1-9b11-7182192d0b57',
        }
    body = """
        {"domainInfos":
          [
            {"description": "music", "name": "867530901",
             "status": "REGISTERED"},
            {"description": "music", "name": "867530902",
             "status": "REGISTERED"},
            {"description": "", "name": "Demo", "status": "REGISTERED"}
          ]
        } """
    httpretty.register_uri(httpretty.POST,
                           "https://swf.us-east-1.amazonaws.com/",
                           content_type='application/json',
                           adding_headers=headers,

# Path: caravan/tests/util.py
# def mock_args(args):
#     return mock.patch('sys.argv', ['PROG'] + args)
# 
# Path: caravan/commands/domain_list.py
# class Command(BaseCommand):
# 
#     description = 'List domains'
# 
#     def setup_arguments(self, parser):
#         parser.add_argument('--deprecated',
#                             dest='registration_status',
#                             action='store_const',
#                             const='DEPRECATED',
#                             default='REGISTERED')
# 
#     def run(self):
#         response = run_swf_command(
#             'list_domains',
#             registrationStatus=self.args.registration_status
#             )
# 
#         return response['domainInfos']


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





def httpretty_register():
    headers = {
        'x-amzn-RequestId': 'd68969c7-3f0d-11e1-9b11-7182192d0b57',
        }
    body = """
        {"domainInfos":
          [
            {"description": "music", "name": "867530901",
             "status": "REGISTERED"},
            {"description": "music", "name": "867530902",
             "status": "REGISTERED"},
            {"description": "", "name": "Demo", "status": "REGISTERED"}
          ]
        } """
    httpretty.register_uri(httpretty.POST,
                           "https://swf.us-east-1.amazonaws.com/",
                           content_type='application/json',
                           adding_headers=headers,

                           body=body)