# Path: habitat/utils/dynamicloader.py
# def load(loadable, force_reload=False):
# def fullname(loadable):
# def isclass(thing):
# def isfunction(thing):
# def isgeneratorfunction(thing):
# def issubclass(thing, the_other_thing):
# def hasattr(thing, attr):
# def isstandardfunction(thing):
# def hasnumargs(thing, num):
# def hasmethod(loadable, name):
# def iscallable(loadable):
# def _expectify(error):
#     def decorator(function):
#         def new_function(*args, **kwargs):
# 
# Path: habitat/tests/test_utils/test_dynamicloader/example_module.py
# class AClass(Parent, Parent2):
#     anattr = "asdf"
#     afunc = afunction


import sys
import os
import time
import datetime
import tempfile
import shutil
from nose.tools import raises
from ....utils import dynamicloader
from . import example_module
from .example_module import AClass
        # import AClass by this route (see above). fullname must tolerate this
        acwn = __name__ + ".AClass"
        assert dynamicloader.fullname(acwn) == lmn + ".AClass"

    @raises(TypeError)
    def test_fullname_rejects_garbage(self):
        dynamicloader.fullname(1234)


class TestInspectors:
    def test_isclass(self):
        fn = dynamicloader.isclass
        ex = dynamicloader.expectisclass
        self.check_function_success(fn, ex, example_module.AClass)
        self.check_function_failure(fn, ex, example_module.AFunction,
            TypeError)
        self.check_function_failure(fn, ex, "asdf", TypeError)

    def test_issubclass(self):
        fn = dynamicloader.issubclass
        ex = dynamicloader.expectissubclass
        self.check_value_function(fn, ex, example_module.CClass,
            example_module.Parent2, example_module.BClass, TypeError)

    def test_isfunction(self):
        """isfunction, isgeneratorfunction, isstandardfunction, iscallable"""
        fnn = dynamicloader.isfunction
        exn = dynamicloader.expectisfunction
        fns = dynamicloader.isstandardfunction
        exs = dynamicloader.expectisstandardfunction

# Path: habitat/utils/dynamicloader.py
# def load(loadable, force_reload=False):
# def fullname(loadable):
# def isclass(thing):
# def isfunction(thing):
# def isgeneratorfunction(thing):
# def issubclass(thing, the_other_thing):
# def hasattr(thing, attr):
# def isstandardfunction(thing):
# def hasnumargs(thing, num):
# def hasmethod(loadable, name):
# def iscallable(loadable):
# def _expectify(error):
#     def decorator(function):
#         def new_function(*args, **kwargs):
# 
# Path: habitat/tests/test_utils/test_dynamicloader/example_module.py
# class AClass(Parent, Parent2):
#     anattr = "asdf"
#     afunc = afunction


# Path: habitat/tests/test_utils/test_dynamicloader/test_dynamicloader.py
import sys
import os
import time
import datetime
import tempfile
import shutil
from nose.tools import raises
from ....utils import dynamicloader
from . import example_module
from .example_module import AClass

        # import AClass by this route (see above). fullname must tolerate this
        acwn = __name__ + ".AClass"
        assert dynamicloader.fullname(acwn) == lmn + ".AClass"

    @raises(TypeError)
    def test_fullname_rejects_garbage(self):
        dynamicloader.fullname(1234)


class TestInspectors:
    def test_isclass(self):
        fn = dynamicloader.isclass
        ex = dynamicloader.expectisclass
        self.check_function_success(fn, ex, example_module.AClass)
        self.check_function_failure(fn, ex, example_module.AFunction,
            TypeError)
        self.check_function_failure(fn, ex, "asdf", TypeError)

    def test_issubclass(self):
        fn = dynamicloader.issubclass
        ex = dynamicloader.expectissubclass
        self.check_value_function(fn, ex, example_module.CClass,
            example_module.Parent2, example_module.BClass, TypeError)

    def test_isfunction(self):
        """isfunction, isgeneratorfunction, isstandardfunction, iscallable"""
        fnn = dynamicloader.isfunction
        exn = dynamicloader.expectisfunction
        fns = dynamicloader.isstandardfunction
        exs = dynamicloader.expectisstandardfunction

        fng = dynamicloader.isgeneratorfunction