# Make the tests directory a python module
# so that all unit tests are reported as part of the tests package.
import os

from tests.data import TEST_CONFIG

# Inject mandatory environment variables

env_settings = [
    ("CREDENTIALS_SLACK_VERIFICATION_TOKEN_A12345678", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_TOKEN_A12345678", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_BOT_TOKEN_A12345678", "1234"),
    ("CREDENTIALS_SLACK_VERIFICATION_TOKEN_AABCDEF12", "5555"),
    ("CREDENTIALS_SLACK_OAUTH_TOKEN_AABCDEF12", "5555"),
    ("CREDENTIALS_SLACK_OAUTH_BOT_TOKEN_AABCDEF12", "5555"),
    ("CREDENTIALS_SLACK_VERIFICATION_TOKEN_A11111111", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_TOKEN_A11111111", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_BOT_TOKEN_A11111111", "1234"),
    ("CREDENTIALS_SLACK_VERIFICATION_TOKEN_A22222222", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_TOKEN_A22222222", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_BOT_TOKEN_A22222222", "1234"),
    ("CREDENTIALS_SLACK_VERIFICATION_TOKEN_A12121212", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_TOKEN_A12121212", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_BOT_TOKEN_A12121212", "1234"),
    ("CREDENTIALS_SLACK_VERIFICATION_TOKEN_A98765432", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_TOKEN_A98765432", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_TOKEN_A12FEDCBA", "1234"),
    ("CREDENTIALS_SLACK_OAUTH_BOT_TOKEN_A12FEDCBA", "1234"),
    ("CREDENTIALS_SLACK_VERIFICATION_TOKEN_A99999999", "1234"),
    # Integration test setup
    (
        "CREDENTIALS_SLACK_VERIFICATION_TOKEN_TEST_OMNIBOT_ID",
        "ABCDEFGHIJKLMNOPQRSTUVWX",
    ),
    ("CREDENTIALS_SLACK_OAUTH_TOKEN_TEST_OMNIBOT_ID", "ABCDEFGHIJKLMNOPQRSTUVWX"),
    ("CREDENTIALS_SLACK_OAUTH_BOT_TOKEN_TEST_OMNIBOT_ID", "ABCDEFGHIJKLMNOPQRSTUVWX"),
]

os.environ["CONFIG_FILE"] = TEST_CONFIG
for env_setting in env_settings:
    os.environ[env_setting[0]] = os.getenv(env_setting[0], env_setting[1])
