Example #1
0
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)
Example #2
0
def test_latest():
    response = Client('/latest').get()
    response_handler(response)
Example #3
0
def test_without_access_key():
    client = Client('/latest')
    client.access_key = None
    response = client.get()
    check_error.missing_access_key(response)
Example #4
0
def test_invalid_access_key():
    response = Client('/latest', access_key='invalid').get()
    check_error.invalid_access_key(response)
Example #5
0
def test_empty_symbols():
    response = Client('/latest').get({'symbols': ''})
    response_handler(response)
Example #6
0
def test_valid_and_invalid_symbols():
    response = Client('/latest').get({'symbols': 'OMS,RUB'})
    response_handler(response, symbols=['RUB'])
Example #7
0
def test_invalid_symbols(symbols):
    response = Client('/latest').get({'symbols': symbols})
    check_error.invalid_currency_codes(response)
Example #8
0
def test_symbols(symbols):
    response = Client('/latest').get({'symbols': symbols})
    response_handler(response, symbols=['RUB', 'USD'])
Example #9
0
def client():
    return Client()