# Path: snakeguice/scopes.py
# class _NoScope(object):
#     """A default scrope returns the same provider that gets passed in.
# 
#     This is internally used and will probably never be directly used in
#     a module.
#     """
# 
#     def scope(self, key, unscoped_provider): # pylint: disable-msg=R0201,W0613
#         return unscoped_provider
# 
# class _Singleton(object):
#     """A singleton scope only allows a single instance to be created for a
#     given key.
#     """
# 
#     def __init__(self):
#         self._cached_provider_map = {}
# 
#     def scope(self, key, provider):
#         cached_provider = self._cached_provider_map.get(key)
#         if not cached_provider:
#             instance = provider.get()
#             cached_provider = self._cached_provider_map[key] = \
#                     providers.create_instance_provider(instance)
#         return cached_provider


from snakeguice.scopes import _NoScope, _Singleton


class FakeProvider(object):

    def get(self):
        return object()


class test_the_NoScope_scope(object):

    def setup(self):
        self.provider = FakeProvider()
        self.scope = _NoScope()

    def test_that_the_provider_is_passed_through(self):
        assert self.scope.scope('key', self.provider) is self.provider


class test_the_Singleton_scope(object):


# Path: snakeguice/scopes.py
# class _NoScope(object):
#     """A default scrope returns the same provider that gets passed in.
# 
#     This is internally used and will probably never be directly used in
#     a module.
#     """
# 
#     def scope(self, key, unscoped_provider): # pylint: disable-msg=R0201,W0613
#         return unscoped_provider
# 
# class _Singleton(object):
#     """A singleton scope only allows a single instance to be created for a
#     given key.
#     """
# 
#     def __init__(self):
#         self._cached_provider_map = {}
# 
#     def scope(self, key, provider):
#         cached_provider = self._cached_provider_map.get(key)
#         if not cached_provider:
#             instance = provider.get()
#             cached_provider = self._cached_provider_map[key] = \
#                     providers.create_instance_provider(instance)
#         return cached_provider


# Path: tests/test_scopes.py
from snakeguice.scopes import _NoScope, _Singleton



class FakeProvider(object):

    def get(self):
        return object()


class test_the_NoScope_scope(object):

    def setup(self):
        self.provider = FakeProvider()
        self.scope = _NoScope()

    def test_that_the_provider_is_passed_through(self):
        assert self.scope.scope('key', self.provider) is self.provider


class test_the_Singleton_scope(object):


    def setup(self):