#NEWLINE# def test_creates_object_graph_using_given_scopes( self ) : #NEWLINE# #INDENT# class SomeClass ( object ) : #NEWLINE# #INDENT# def __init__( self , foo ) : #NEWLINE# #INDENT# self . foo = foo #NEWLINE# #UNINDENT# #UNINDENT# class SomeBindingSpec ( bindings . BindingSpec ) : #NEWLINE# #INDENT# @ decorators . provides ( in_scope = 'foo-scope' ) #NEWLINE# def provide_foo( self ) : #NEWLINE# #INDENT# return object ( ) #NEWLINE# #UNINDENT# #UNINDENT# obj_graph = object_graph . new_object_graph ( modules = None , classes = [ SomeClass ] , binding_specs = [ SomeBindingSpec ( ) ] , id_to_scope = { #NEWLINE# #INDENT# 'foo-scope' : scoping . SingletonScope ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# some_class_one = obj_graph . provide ( SomeClass ) #NEWLINE# some_class_two = obj_graph . provide ( SomeClass ) #NEWLINE# self . assertIs ( obj_graph . foo , some_class_two . foo )