#NEWLINE# def test_can_provide_using_provider_fn( self ) : #NEWLINE# #INDENT# class ClassOne ( object ) : #NEWLINE# #INDENT# def __init__( self , foo ) : #NEWLINE# #INDENT# self . foo = foo #NEWLINE# #UNINDENT# #UNINDENT# class SomeBindingSpec ( bindings . BindingSpec ) : #NEWLINE# #INDENT# def provide_foo( self ) : #NEWLINE# #INDENT# return 'a-foo' #NEWLINE# #UNINDENT# #UNINDENT# obj_graph = object_graph . new_object_graph ( modules = None , classes = [ ClassOne ] , binding_specs = [ SomeBindingSpec ( ) ] ) #NEWLINE# class_one = obj_graph . provide ( ClassOne ) #NEWLINE# self . assertEqual ( 'a-foo' , self . foo )