#NEWLINE# def test_assemblies_post_ref_rel_uris( self , PlanHandler , AssemblyHandler , resp_mock , request_mock ) : #NEWLINE# #INDENT# hand_get = PlanHandler . return_value . get #NEWLINE# hand_get . return_value = fakes . FakePlan ( ) #NEWLINE# hand_create_from_plan = AssemblyHandler . return_value . create_from_plan #NEWLINE# fake_assembly = fakes . FakeAssembly ( ) #NEWLINE# hand_create_from_plan . return_value = fake_assembly #NEWLINE# cntrl = assemblies . AssembliesController ( ) #NEWLINE# ref_object = { #NEWLINE# #INDENT# 'plan_uri' : '../plans/24e3974c-195d-4a6a-96b0-7924ed3c742a' , #NEWLINE# #UNINDENT# } #NEWLINE# request_mock . content_type = 'application/json' #NEWLINE# request_mock . body = json . dumps ( ref_object ) #NEWLINE# resp = cntrl . post ( ) #NEWLINE# self . assertIsNotNone ( resp ) #NEWLINE# self . assertEqual ( 201 , resp_mock . status ) #NEWLINE# self . assertIsNotNone ( resp_mock . location ) #NEWLINE# self . assertEqual ( fake_assembly . name , resp [ 'name' ] ) #NEWLINE# ref_object = { #NEWLINE# #INDENT# 'plan_uri' : '../../../v1/plans/24e3974c-195d-4a6a-96b0-7924ed3c742a' , #NEWLINE# #UNINDENT# } #NEWLINE# request_mock . content_type = 'application/json' #NEWLINE# request_mock . body = json . dumps ( ref_object ) #NEWLINE# resp = cntrl . post ( ) #NEWLINE# self . assertIsNotNone ( resp ) #NEWLINE# self . assertEqual ( 201 , resp_mock . status ) #NEWLINE# self . assertIsNotNone ( resp_mock . location ) #NEWLINE# self . assertEqual ( fake_assembly . name , resp [ 'name' ] ) #NEWLINE# ref_object = { #NEWLINE# #INDENT# 'plan_uri' : '/camp/v1_1/plans/24e3974c-195d-4a6a-96b0-7924ed3c742a' , #NEWLINE# #UNINDENT# } #NEWLINE# request_mock . content_type = 'application/json' #NEWLINE# request_mock . body = json . dumps ( ref_object ) #NEWLINE# resp = cntrl . post ( ) #NEWLINE# self . assertIsNotNone ( resp ) #NEWLINE# self . assertEqual ( 201 , resp_mock . status ) #NEWLINE# self . assertIsNotNone ( resp_mock . location ) #NEWLINE# self . assertEqual ( fake_assembly . name , resp [ 'name' ] ) #NEWLINE# ref_object = { #NEWLINE# #INDENT# 'plan_uri' : '/v1/plans/24e3974c-195d-4a6a-96b0-7924ed3c742a' , #NEWLINE# #UNINDENT# } #NEWLINE# request_mock . content_type = 'application/json' #NEWLINE# request_mock . body = json . dumps ( self ) #NEWLINE# resp = cntrl . post ( ) #NEWLINE# self . assertIsNotNone ( resp ) #NEWLINE# self . assertEqual ( 201 , resp_mock . status ) #NEWLINE# self . assertIsNotNone ( resp_mock . location ) #NEWLINE# self . assertEqual ( fake_assembly . name , resp [ 'name' ] )