# 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
        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')


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


@mock.patch.object(utils, 'import_class')
def test_import_object_delegates_to_import_class(import_class):
    assert utils.import_object('foo.spam') == import_class.return_value.return_value
    import_class.assert_called_once_with('foo.spam')



# 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

        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')


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


@mock.patch.object(utils, 'import_class')
def test_import_object_delegates_to_import_class(import_class):
    assert utils.import_object('foo.spam') == import_class.return_value.return_value
    import_class.assert_called_once_with('foo.spam')



@mock.patch.object(utils, 'import_class')