def get_args(self, kind=None): mock_parse = get_mock_parser() if kind is not None: type(mock_parse.return_value).kind = mock.PropertyMock( return_value=kind) with mock.patch('argparse.ArgumentParser.parse_args', mock_parse): return get_arguments_parser().parse_args()
def setUp(self): super(BaseInvoicesUtilityTest, self).setUp() mock_parse = get_mock_parser() with mock.patch('argparse.ArgumentParser.parse_args', mock_parse): args = get_arguments_parser().parse_args() config = read_config(args.config) self.utility = invoices.InvoicesUtility(args.broker, args.period, config)
def run(): parser = get_arguments_parser() args = parser.parse_args() config = read_config(args.config) dictConfig(config) utility = BidsUtility(args.broker, args.period, config, timezone=args.timezone) utility.run()
def run(): parser = get_arguments_parser() args = parser.parse_args() config = read_config(args.config) dictConfig(config) utility = InvoicesUtility( args.broker, args.period, config, timezone=args.timezone) utility.run()
def setUp(self): super(BaseRefundsUtilityTest, self).setUp() mock_parse = get_mock_parser() type(mock_parse.return_value).kind = mock.PropertyMock( return_value=['general']) with mock.patch('argparse.ArgumentParser.parse_args', mock_parse): args = get_arguments_parser().parse_args() config = read_config(args.config) self.utility = refunds.RefundsUtility(args.broker, args.period, config, kind=args.kind)
def run(): parser = get_arguments_parser() args = parser.parse_args() config = read_config(args.config) dictConfig(config) utility = TendersProzorroMarketUtility(args.broker, args.period, config, timezone=args.timezone, mode=args.mode) utility.run()
def run(): parser = get_arguments_parser() parser.add_argument('--kind', metavar='Kind', action=Kind, help='Kind filtering functionality. ' 'Usage: --kind <include, exclude, one>=<kinds>') args = parser.parse_args() config = read_config(args.config) dictConfig(config) utility = RefundsUtility(args.broker, args.period, config, timezone=args.timezone) utility.run()
def run(): parser = get_arguments_parser() parser.add_argument( '--kind', metavar='Kind', action=Kind, help='Kind filtering functionality. ' 'Usage: --kind <include, exclude, one>=<kinds>' ) args = parser.parse_args() config = read_config(args.config) dictConfig(config) utility = TendersUtility( args.broker, args.period, config, timezone=args.timezone) utility.kinds = args.kind utility.run()