def launch(): """Launch the bot.""" definitions.ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) initialisation.initialise_commands() initialisation.initialise_languages() database_functions.connect() initialisation.update_config_data() language_synchronisation.synchronise() definitions.CLIENT = Client() definitions.CLIENT.run(secrets.BOT_TOKEN)
def test_latest(): response = Client('/latest').get() response_handler(response)
def test_without_access_key(): client = Client('/latest') client.access_key = None response = client.get() check_error.missing_access_key(response)
def test_invalid_access_key(): response = Client('/latest', access_key='invalid').get() check_error.invalid_access_key(response)
def test_empty_symbols(): response = Client('/latest').get({'symbols': ''}) response_handler(response)
def test_valid_and_invalid_symbols(): response = Client('/latest').get({'symbols': 'OMS,RUB'}) response_handler(response, symbols=['RUB'])
def test_invalid_symbols(symbols): response = Client('/latest').get({'symbols': symbols}) check_error.invalid_currency_codes(response)
def test_symbols(symbols): response = Client('/latest').get({'symbols': symbols}) response_handler(response, symbols=['RUB', 'USD'])
def client(): return Client()