def call_customer(self, other_args: List[str]): """Process customer command""" parser = argparse.ArgumentParser( prog="customer", add_help=False, description= "List of customers from ticker provided. [Source: CSIMarket]", ) parser.add_argument( "--export", choices=["csv", "json", "xlsx"], default="", type=str, dest="export", help="Export dataframe data to csv,json,xlsx file", ) try: ns_parser = parse_known_args_and_warn(parser, other_args) if not ns_parser: return csimarket_view.customers( ticker=self.ticker, export=ns_parser.export, ) except Exception as e: print(e, "\n")
def call_customer(self, other_args: List[str]): """Process customer command""" parser = argparse.ArgumentParser( prog="customer", add_help=False, description= "List of customers from ticker provided. [Source: CSIMarket]", ) ns_parser = parse_known_args_and_warn(parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED) if ns_parser: csimarket_view.customers( ticker=self.ticker, export=ns_parser.export, )
def test_get_customers_invalid(): csimarket_view.customers(ticker="INVALID_TICKER", export=None)
def test_get_customers(): csimarket_view.customers(ticker="TSLA", export=None)