예제 #1
0
    def test_build_config_wo_user_prefix(self, plain_config_without_user_prefix):
        loader = ConfigSetLoader()
        config = loader.build_config(plain_config_without_user_prefix)

        assert config
        assert config.name is None
        assert config.user == Config.prefixed_user(
            plain_config_without_user_prefix['abeja-platform-user'])
        assert config.token == plain_config_without_user_prefix['personal-access-token']
        assert config.organization == plain_config_without_user_prefix['organization-name']
예제 #2
0
    create_job_definition, create_training_job, create_training_model,
    create_training_version, describe_jobs, describe_training_models,
    describe_training_versions, download_training_model, initialize_training,
    unarchive_job, unarchive_training_model, unarchive_version,
    update_training_model)
from tests import get_tmp_training_file_name
from tests.unit import ConfigPatcher

TEST_CONFIG_FILE_ROOT = '/tmp/.abeja'
TEST_CONFIG_FILE_PATH = os.path.join(TEST_CONFIG_FILE_ROOT, 'config')

TEST_CONFIG_USER_ID = '12345'
TEST_CONFIG_TOKEN = 'ntoken12345'
TEST_CONFIG_ORG_NAME = 'test-inc'
TEST_CONFIG = {
    'abeja-platform-user': Config.prefixed_user(TEST_CONFIG_USER_ID),
    'personal-access-token': TEST_CONFIG_TOKEN,
    'organization-name': TEST_CONFIG_ORG_NAME
}

TEST_CONFIG_USER_ID_2 = '2039587479106'
TEST_CONFIG_TOKEN_2 = '34676abf4875998fbe7fd4637'
TEST_CONFIG_ORG_NAME_2 = 'banana-fish'
TEST_CONFIG_2 = {
    'abeja-platform-user': Config.prefixed_user(TEST_CONFIG_USER_ID_2),
    'personal-access-token': TEST_CONFIG_TOKEN_2,
    'organization-name': TEST_CONFIG_ORG_NAME_2
}

TEST_ORGANIZATION_DOMAIN = 'http://apidomain/organizations/test'
yaml = YAML()