コード例 #1
0
    def call_supplier(self, other_args: List[str]):
        """Process supplier command"""
        parser = argparse.ArgumentParser(
            prog="supplier",
            add_help=False,
            description=
            "List of suppliers 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.suppliers(
                ticker=self.ticker,
                export=ns_parser.export,
            )

        except Exception as e:
            print(e, "\n")
コード例 #2
0
    def call_supplier(self, other_args: List[str]):
        """Process supplier command"""
        parser = argparse.ArgumentParser(
            prog="supplier",
            add_help=False,
            description=
            "List of suppliers 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.suppliers(
                ticker=self.ticker,
                export=ns_parser.export,
            )
コード例 #3
0
def test_get_suppliers_invalid():
    csimarket_view.suppliers(ticker="INVALID_TICKER", export=None)
コード例 #4
0
def test_get_suppliers():
    csimarket_view.suppliers(ticker="TSLA", export=None)