def test_set_headless_command(self):
     """ --headless command should be set """
     parse_args(self.argparse_mock)
     self.argparse_mock.add_argument.assert_any_call(
         "-head",
         "--headless",
         required=False,
         help="Should browser be run headlessly",
         action="count")
 def test_set_ad_block_path_command(self):
     """ --block command should be set """
     parse_args(self.argparse_mock)
     self.argparse_mock.add_argument.assert_any_call(
         "-bl",
         "--block",
         required=False,
         help="Path to ad blocking extension",
         action="store",
         type=str)
 def test_set_bot_command(self):
     """ --bot command should be set """
     parse_args(self.argparse_mock)
     self.argparse_mock.add_argument.assert_any_call(
         "-b",
         "--bot",
         required=True,
         help="Which bot should be used",
         action="store",
         type=str)
 def test_set_scema_command(self):
     """ --path command should be set """
     parse_args(self.argparse_mock)
     self.argparse_mock.add_argument.assert_any_call(
         "-s",
         "--scema",
         required=True,
         help="Path to database scema script",
         action="store",
         type=str)
 def test_set_path_command(self):
     """ --path command should be set """
     parse_args(self.argparse_mock)
     self.argparse_mock.add_argument.assert_any_call(
         "-p",
         "--path",
         required=True,
         help="Path to output files",
         action="store",
         type=str)
""" Bot that deals with js applications """
from argparse import ArgumentParser
from interactive_bots.commons.utils import parse_args
from interactive_bots.diagnosis_online_bot.reactive_bot import run as diagnosis_online_run

if __name__ == "__main__":
    args = parse_args(ArgumentParser())
    if args.bot == "diagnosis_online":
        diagnosis_online_run(args)
    else:
        print("Bot not found")
 def test_parse_args_should_be_called(self):
     """ After setting up commands arguments must be parsed """
     parse_args(self.argparse_mock)
     self.assertTrue(self.argparse_mock.parse_args.called)