def test_display_ark_trades_no_tab(mocker):
    mocker.patch(
        target="gamestonk_terminal.feature_flags.USE_TABULATE_DF",
        new=False,
    )

    ark_view.display_ark_trades(ticker="TSLA")
def test_display_ark_trades_export(capsys, mocker):
    ark_view.export_data = mocker.Mock()

    ark_view.display_ark_trades(ticker="TSLA", export="csv")

    capsys.readouterr()

    ark_view.export_data.assert_called_once()
 def call_arktrades(self, other_args):
     """Process arktrades command"""
     parser = argparse.ArgumentParser(
         add_help=False,
         prog="arktrades",
         description="""
             Get trades for ticker across all ARK funds.
         """,
     )
     parser.add_argument(
         "-n",
         "--num",
         help="Number of rows to show",
         dest="num",
         default=20,
         type=int,
     )
     parser.add_argument(
         "-s",
         "--show_ticker",
         action="store_true",
         default=False,
         help="Flag to show ticker in table",
         dest="show_ticker",
     )
     try:
         ns_parser = parse_known_args_and_warn(
             parser, other_args, export_allowed=EXPORT_ONLY_RAW_DATA_ALLOWED
         )
         if not ns_parser:
             return
         ark_view.display_ark_trades(
             ticker=self.ticker,
             num=ns_parser.num,
             export=ns_parser.export,
             show_ticker=ns_parser.show_ticker,
         )
     except Exception as e:
         print(e, "\n")
示例#4
0
 def call_arktrades(self, other_args):
     """Process arktrades command"""
     parser = argparse.ArgumentParser(
         add_help=False,
         prog="arktrades",
         description="""
             Get trades for ticker across all ARK funds.
         """,
     )
     parser.add_argument(
         "-l",
         "--limit",
         help="Limit of rows to show",
         dest="limit",
         default=10,
         type=check_positive,
     )
     parser.add_argument(
         "-s",
         "--show_ticker",
         action="store_true",
         default=False,
         help="Flag to show ticker in table",
         dest="show_ticker",
     )
     if other_args and "-" not in other_args[0][0]:
         other_args.insert(0, "-l")
     ns_parser = parse_known_args_and_warn(
         parser, other_args, export_allowed=EXPORT_ONLY_RAW_DATA_ALLOWED
     )
     if ns_parser:
         ark_view.display_ark_trades(
             ticker=self.ticker,
             num=ns_parser.limit,
             export=ns_parser.export,
             show_ticker=ns_parser.show_ticker,
         )
def test_display_ark_trades_default():
    ark_view.display_ark_trades(ticker="TSLA")
def test_display_ark_trades_invalid_ticker():
    ark_view.display_ark_trades(ticker="INVALID_TICKER")