# Path: snakeguice/injector.py
# class ProvidesBinderHelper(object):
#         class GenericProvider(object):
# class Injector(object):
#         class DynamicProvider(object):
#     def bind_providers(self, module, binder):
#     def _build_provider(self, module, type, method):
#             def __init__(self, injector):
#             def get(self):
#     def __init__(self, modules=None, binder=None, stage=None):
#     def add_modules(self, modules):
#     def get_provider(self, cls, annotation=None):
#             def get(self):
#     def get_instance(self, cls, annotation=None):
#     def create_child(self, modules):
#     def create_object(self, cls):
#     def inject_members(self, instance):
# def create_injector(modules):
# 
# Path: snakeguice/binder.py
# class Key(object):
# class _EmptyBinder(object):
# class Binder(object):
# class LazyBinder(object):
# class Binding(object):
# class BinderErrorRecord(object):
#     def __init__(self, interface, annotation=None):
#     def __hash__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def get_binding(self, key):
#     def __init__(self, parent=None):
#     def bind(self, _class, **kwargs):
#     def get_binding(self, key):
#     def create_child(self):
#     def __init__(self, parent=None):
#     def add_error(self, msg):
#     def errors(self):
#     def bind(self, _class, **kwargs):
#     def get_binding(self, key):
#     def create_child(self):
#     def __init__(self, key=None, provider=None, scope=None):
#     def __init__(self, message, location, source):


from snakeguice import create_injector, injector, binder
import cls_heirarchy as ch
    person = child_inj.get_instance(ch.Person, 'good')
    assert isinstance(person, ch.GoodPerson)


class test_using_create_injector_factory(object):

    def setup(self):
        class PeopleModule(object):
            def configure(self, binder):
                binder.bind(ch.Person, to=ch.EvilPerson)
        self.injector = create_injector([PeopleModule()])
        self.instance = self.injector.get_instance(ch.Person)

    def test_an_injector_was_returned(self):
        assert isinstance(self.injector, injector.Injector)

    def test_correct_instance_was_created(self):
        assert isinstance(self.instance, ch.EvilPerson)


def test_create_an_injector_without_any_modules():
    modules = [FakeModule(), FakeModule(), FakeModule()]


class test_using_get_provider(object):

    def setup(self):
        class PeopleModule(object):
            def configure(self, binder):
                binder.bind(ch.Person, to=ch.EvilPerson)

# Path: snakeguice/injector.py
# class ProvidesBinderHelper(object):
#         class GenericProvider(object):
# class Injector(object):
#         class DynamicProvider(object):
#     def bind_providers(self, module, binder):
#     def _build_provider(self, module, type, method):
#             def __init__(self, injector):
#             def get(self):
#     def __init__(self, modules=None, binder=None, stage=None):
#     def add_modules(self, modules):
#     def get_provider(self, cls, annotation=None):
#             def get(self):
#     def get_instance(self, cls, annotation=None):
#     def create_child(self, modules):
#     def create_object(self, cls):
#     def inject_members(self, instance):
# def create_injector(modules):
# 
# Path: snakeguice/binder.py
# class Key(object):
# class _EmptyBinder(object):
# class Binder(object):
# class LazyBinder(object):
# class Binding(object):
# class BinderErrorRecord(object):
#     def __init__(self, interface, annotation=None):
#     def __hash__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def get_binding(self, key):
#     def __init__(self, parent=None):
#     def bind(self, _class, **kwargs):
#     def get_binding(self, key):
#     def create_child(self):
#     def __init__(self, parent=None):
#     def add_error(self, msg):
#     def errors(self):
#     def bind(self, _class, **kwargs):
#     def get_binding(self, key):
#     def create_child(self):
#     def __init__(self, key=None, provider=None, scope=None):
#     def __init__(self, message, location, source):


# Path: tests/test_injector.py
from snakeguice import create_injector, injector, binder
import cls_heirarchy as ch

    person = child_inj.get_instance(ch.Person, 'good')
    assert isinstance(person, ch.GoodPerson)


class test_using_create_injector_factory(object):

    def setup(self):
        class PeopleModule(object):
            def configure(self, binder):
                binder.bind(ch.Person, to=ch.EvilPerson)
        self.injector = create_injector([PeopleModule()])
        self.instance = self.injector.get_instance(ch.Person)

    def test_an_injector_was_returned(self):
        assert isinstance(self.injector, injector.Injector)

    def test_correct_instance_was_created(self):
        assert isinstance(self.instance, ch.EvilPerson)


def test_create_an_injector_without_any_modules():
    modules = [FakeModule(), FakeModule(), FakeModule()]


class test_using_get_provider(object):

    def setup(self):
        class PeopleModule(object):
            def configure(self, binder):
                binder.bind(ch.Person, to=ch.EvilPerson)

        self.injector = create_injector([PeopleModule()])