# Path: pyqi/commands/make_command.py
# class MakeCommand(CodeHeaderGenerator):
#     BriefDescription = "Construct a stubbed out Command object"
#     LongDescription = ("This command is intended to construct the basics of a "
#         "Command object so that a developer can dive straight into the "
#         "implementation of the command")
# 
#     CommandIns = ParameterCollection(
#           CodeHeaderGenerator.CommandIns.Parameters + [
#           CommandIn(Name='name', DataType=str,
#                     Description='the name of the Command', Required=True),
#           CommandIn(Name='test_code', DataType=bool,
#                     Description='create stubbed out unit test code',
#                     Required=False, Default=False)
#           ]
#     )
#     CommandOuts = ParameterCollection([
#           CommandOut(Name='result',DataType=list, 
#                     Description='The resulting template')
#           ]
#     )
# 
#     def run(self, **kwargs):
#         code_header_lines = super(MakeCommand, self).run(
#                 author=kwargs['author'], email=kwargs['email'],
#                 license=kwargs['license'], copyright=kwargs['copyright'],
#                 version=kwargs['version'], credits=kwargs['credits'])['result']
# 
#         result_lines = code_header_lines
# 
#         if kwargs['test_code']:
#             result_lines.extend(
#                     (test_format % {'name': kwargs['name']}).split('\n'))
#         else:
#             result_lines.extend(command_imports.split('\n'))
#             result_lines.append('')
#             result_lines.extend((command_format % (
#                     kwargs['name'], kwargs['name'])).split('\n'))
# 
#         return {'result':  result_lines}


from unittest import TestCase, main
from pyqi.commands.make_command import MakeCommand
class Test(Command):
    BriefDescription = "FILL IN A 1 SENTENCE DESCRIPTION"
    LongDescription = "GO INTO MORE DETAIL"
    CommandIns = ParameterCollection([
        CommandIn(Name='foo', DataType=str,
                  Description='some required parameter', Required=True),
        CommandIn(Name='bar', DataType=int,
                  Description='some optional parameter', Required=False,
                  Default=1)
    ])

    CommandOuts = ParameterCollection([
        CommandOut(Name="result_1", DataType=str, Description="xyz"),
        CommandOut(Name="result_2", DataType=str, Description="123"),
    ])

    def run(self, **kwargs):
        # EXAMPLE:
        # return {'result_1': kwargs['foo'] * kwargs['bar'],
        #         'result_2': "Some output bits"}
        raise NotImplementedError("You must define this method")

CommandConstructor = Test"""

exp_test_code1 = """#!/usr/bin/env python
from __future__ import division

__author__ = "bob"
__copyright__ = "what's that?"
__credits__ = ["bob", "another person"]

# Path: pyqi/commands/make_command.py
# class MakeCommand(CodeHeaderGenerator):
#     BriefDescription = "Construct a stubbed out Command object"
#     LongDescription = ("This command is intended to construct the basics of a "
#         "Command object so that a developer can dive straight into the "
#         "implementation of the command")
# 
#     CommandIns = ParameterCollection(
#           CodeHeaderGenerator.CommandIns.Parameters + [
#           CommandIn(Name='name', DataType=str,
#                     Description='the name of the Command', Required=True),
#           CommandIn(Name='test_code', DataType=bool,
#                     Description='create stubbed out unit test code',
#                     Required=False, Default=False)
#           ]
#     )
#     CommandOuts = ParameterCollection([
#           CommandOut(Name='result',DataType=list, 
#                     Description='The resulting template')
#           ]
#     )
# 
#     def run(self, **kwargs):
#         code_header_lines = super(MakeCommand, self).run(
#                 author=kwargs['author'], email=kwargs['email'],
#                 license=kwargs['license'], copyright=kwargs['copyright'],
#                 version=kwargs['version'], credits=kwargs['credits'])['result']
# 
#         result_lines = code_header_lines
# 
#         if kwargs['test_code']:
#             result_lines.extend(
#                     (test_format % {'name': kwargs['name']}).split('\n'))
#         else:
#             result_lines.extend(command_imports.split('\n'))
#             result_lines.append('')
#             result_lines.extend((command_format % (
#                     kwargs['name'], kwargs['name'])).split('\n'))
# 
#         return {'result':  result_lines}


# Path: tests/test_commands/test_make_command.py
from unittest import TestCase, main
from pyqi.commands.make_command import MakeCommand

class Test(Command):
    BriefDescription = "FILL IN A 1 SENTENCE DESCRIPTION"
    LongDescription = "GO INTO MORE DETAIL"
    CommandIns = ParameterCollection([
        CommandIn(Name='foo', DataType=str,
                  Description='some required parameter', Required=True),
        CommandIn(Name='bar', DataType=int,
                  Description='some optional parameter', Required=False,
                  Default=1)
    ])

    CommandOuts = ParameterCollection([
        CommandOut(Name="result_1", DataType=str, Description="xyz"),
        CommandOut(Name="result_2", DataType=str, Description="123"),
    ])

    def run(self, **kwargs):
        # EXAMPLE:
        # return {'result_1': kwargs['foo'] * kwargs['bar'],
        #         'result_2': "Some output bits"}
        raise NotImplementedError("You must define this method")

CommandConstructor = Test"""

exp_test_code1 = """#!/usr/bin/env python
from __future__ import division

__author__ = "bob"
__copyright__ = "what's that?"
__credits__ = ["bob", "another person"]

__license__ = "very permissive license"