# 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
        self.check_function_failure(fns, exs, acl, TypeError)
        self.check_function_failure(fns, exs, "asdf", TypeError)
        self.check_function_failure(fng, exg, afn, TypeError)
        self.check_function_success(fng, exg, gfn)
        self.check_function_failure(fng, exg, acl, TypeError)
        self.check_function_failure(fng, exg, "asdf", TypeError)
        self.check_function_success(fni, exi, afn)
        self.check_function_success(fni, exi, gfn)
        self.check_function_success(fni, exi, ccl)
        self.check_function_success(fni, exi, dcl)
        self.check_function_failure(fni, exi, acl, TypeError)
        self.check_function_failure(fni, exi, "asdf", TypeError)

    def test_hasnumargs(self):
        for func, val in [(example_module.AFunction, 0),
                          (example_module.BFunction, 3),
                          (example_module.CClass, 2),
                          (example_module.DClass, 2),
                          (example_module.BClass.a_method, 0)]:

            self.check_value_function(dynamicloader.hasnumargs,
                                      dynamicloader.expecthasnumargs,
                                      func, val, val + 1, TypeError)

    def test_hasstuff(self):
        """hasmethod, hasattr"""
        fna = dynamicloader.hasattr
        exa = dynamicloader.expecthasattr
        fnm = dynamicloader.hasmethod
        exm = dynamicloader.expecthasmethod

# 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

        self.check_function_failure(fns, exs, acl, TypeError)
        self.check_function_failure(fns, exs, "asdf", TypeError)
        self.check_function_failure(fng, exg, afn, TypeError)
        self.check_function_success(fng, exg, gfn)
        self.check_function_failure(fng, exg, acl, TypeError)
        self.check_function_failure(fng, exg, "asdf", TypeError)
        self.check_function_success(fni, exi, afn)
        self.check_function_success(fni, exi, gfn)
        self.check_function_success(fni, exi, ccl)
        self.check_function_success(fni, exi, dcl)
        self.check_function_failure(fni, exi, acl, TypeError)
        self.check_function_failure(fni, exi, "asdf", TypeError)

    def test_hasnumargs(self):
        for func, val in [(example_module.AFunction, 0),
                          (example_module.BFunction, 3),
                          (example_module.CClass, 2),
                          (example_module.DClass, 2),
                          (example_module.BClass.a_method, 0)]:

            self.check_value_function(dynamicloader.hasnumargs,
                                      dynamicloader.expecthasnumargs,
                                      func, val, val + 1, TypeError)

    def test_hasstuff(self):
        """hasmethod, hasattr"""
        fna = dynamicloader.hasattr
        exa = dynamicloader.expecthasattr
        fnm = dynamicloader.hasmethod
        exm = dynamicloader.expecthasmethod

        acl = example_module.AClass