# Path: pymco/utils.py
# def import_class(import_path):
# def import_object(import_path, *args, **kwargs):
# def pem_to_der(pem):
# def load_rsa_key(filename):
# 
# Path: pymco/test/utils.py
# def get_template(name, package=__package__):
# def configfile(ctxt=None):


import collections
import os
import pytest
import six
from pymco import utils
from pymco.test.utils import mock
"""Tests for pymco.utils"""




@pytest.fixture
def client_public():
    path = os.path.join(os.path.dirname(__file__),
                        os.path.pardir,
                        'fixtures',
                        'client-public.pem')
    with open(path, 'rt') as cpf:
        content = cpf.read()

    return content


def test_import_class():
    assert utils.import_class('collections.defaultdict') is collections.defaultdict


def test_import_path__raises_import_error__missing_module():
    with pytest.raises(ImportError):
        utils.import_class('foo.spam')


def test_import_path__raises_import_error__missing_class():
    with pytest.raises(ImportError):

# Path: pymco/utils.py
# def import_class(import_path):
# def import_object(import_path, *args, **kwargs):
# def pem_to_der(pem):
# def load_rsa_key(filename):
# 
# Path: pymco/test/utils.py
# def get_template(name, package=__package__):
# def configfile(ctxt=None):


# Path: tests/unit/test_utils.py
import collections
import os
import pytest
import six
from pymco import utils
from pymco.test.utils import mock

"""Tests for pymco.utils"""




@pytest.fixture
def client_public():
    path = os.path.join(os.path.dirname(__file__),
                        os.path.pardir,
                        'fixtures',
                        'client-public.pem')
    with open(path, 'rt') as cpf:
        content = cpf.read()

    return content


def test_import_class():
    assert utils.import_class('collections.defaultdict') is collections.defaultdict


def test_import_path__raises_import_error__missing_module():
    with pytest.raises(ImportError):
        utils.import_class('foo.spam')


def test_import_path__raises_import_error__missing_class():
    with pytest.raises(ImportError):

        utils.import_class('collections.spam')