# Path: scalrctl/defaults.py
# CONFIG_DIRECTORY = os.path.expanduser(os.environ.get("SCALRCLI_HOME", os.path.join(os.path.expanduser("~"), ".scalr")))
# CONFIG_PATH = os.path.join(CONFIG_DIRECTORY, "%s.yaml" % os.environ.get("SCALRCLI_PROFILE", "default"))
# VERSION = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().strip()
# API_LEVELS = [
#     'user',
#     'account',
#     'global',
# ]
# 
# Path: scalrctl/settings.py
# API_KEY_ID = None
# API_SECRET_KEY = None
# API_VERSION = "v1beta0"
# API_SCHEME = 'https'
# API_HOST = 'my.scalr.com'
# SIGNATURE_VERSION = 'V1-HMAC-SHA256'
# SSL_VERIFY_PEER = True
# GLOBAL_SCOPE_API_KEY_ID = None
# GLOBAL_SCOPE_API_SECRET_KEY = None
# 
# Path: scalrctl/utils.py
# def read_spec(api_level, ext='json'):
# def read_routes():
# def read_scheme():
# def read_config(profile=None):
# def warning(*messages):
# def debug(msg):
# def reraise(message):
#     def draw(event):
#     def __init__(self):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
# class _spinner(object):


import os
from scalrctl import defaults, settings, utils
# -*- coding: utf-8 -*-



def test_read_spec():
    for api_level in defaults.API_LEVELS:
        base_path = '/api/{}/{}'.format(settings.API_VERSION, api_level)
        for ext in ('yaml', 'json'):
            spec = utils.read_spec(api_level, ext=ext)
            assert spec.get('paths')
            assert spec.get('definitions')
            assert spec.get('basePath') == base_path


def test_read_routes():
    routes = utils.read_routes()
    for api_level in defaults.API_LEVELS:

# Path: scalrctl/defaults.py
# CONFIG_DIRECTORY = os.path.expanduser(os.environ.get("SCALRCLI_HOME", os.path.join(os.path.expanduser("~"), ".scalr")))
# CONFIG_PATH = os.path.join(CONFIG_DIRECTORY, "%s.yaml" % os.environ.get("SCALRCLI_PROFILE", "default"))
# VERSION = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().strip()
# API_LEVELS = [
#     'user',
#     'account',
#     'global',
# ]
# 
# Path: scalrctl/settings.py
# API_KEY_ID = None
# API_SECRET_KEY = None
# API_VERSION = "v1beta0"
# API_SCHEME = 'https'
# API_HOST = 'my.scalr.com'
# SIGNATURE_VERSION = 'V1-HMAC-SHA256'
# SSL_VERIFY_PEER = True
# GLOBAL_SCOPE_API_KEY_ID = None
# GLOBAL_SCOPE_API_SECRET_KEY = None
# 
# Path: scalrctl/utils.py
# def read_spec(api_level, ext='json'):
# def read_routes():
# def read_scheme():
# def read_config(profile=None):
# def warning(*messages):
# def debug(msg):
# def reraise(message):
#     def draw(event):
#     def __init__(self):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
# class _spinner(object):


# Path: tests/small/test_utils.py
import os
from scalrctl import defaults, settings, utils

# -*- coding: utf-8 -*-



def test_read_spec():
    for api_level in defaults.API_LEVELS:
        base_path = '/api/{}/{}'.format(settings.API_VERSION, api_level)
        for ext in ('yaml', 'json'):
            spec = utils.read_spec(api_level, ext=ext)
            assert spec.get('paths')
            assert spec.get('definitions')
            assert spec.get('basePath') == base_path


def test_read_routes():
    routes = utils.read_routes()
    for api_level in defaults.API_LEVELS:

        spec = utils.read_spec(api_level, ext='json')