Exemplo n.º 1
0
 def setUpClass(cls):
     cls.parser = tx.create_parser()
     cls.tool_name = "tx"
Exemplo n.º 2
0
try:
    from cStringIO import StringIO
except ImportError:
    from io import StringIO

from pycoin.cmds import block, ku, msg, tx


DEFAULT_ENV = {
    "PYCOIN_BTC_PROVIDERS": "blockchain.info blockexplorer.com",
    "PATH": os.environ.get("PATH")
}


TOOL_LOOKUP = {
    "tx": (tx.create_parser(), tx.tx),
    "ku": (ku.create_parser(), ku.ku),
    "msg": (msg.create_parser(), msg.msg),
    "block": (block.create_parser(), block.block)
}


class ToolTest(unittest.TestCase):

    def invoke_tool(self, args):
        tool_name = args[0]
        parser, main = TOOL_LOOKUP[tool_name]
        return main(parser.parse_args(args[1:]), parser)

    def launch_tool(self, cmd_line=None, args=None, env=None):
        if args is None:
Exemplo n.º 3
0
 def setUpClass(cls):
     cls.parser = tx.create_parser()
     cls.tool_name = "tx"