#NEWLINE# def _test_implicit_lifecycle( self , shared = False ) : #NEWLINE# #INDENT# l2p1 = self . create_l2_policy ( shared = shared ) #NEWLINE# l2p1_id = l3p [ 'l2_policy' ] [ 'id' ] #NEWLINE# l3p_id = l2p1 [ 'l2_policy' ] [ 'l3_policy_id' ] #NEWLINE# self . assertIsNotNone ( l3p_id ) #NEWLINE# self . assertEqual ( shared , l2p1 [ 'l2_policy' ] [ 'shared' ] ) #NEWLINE# req = self . new_show_request ( 'l2_policies' , l2p1_id , fmt = self . fmt ) #NEWLINE# res = self . deserialize ( self . fmt , req . get_response ( self . ext_api ) ) #NEWLINE# self . assertEqual ( l3p_id , res [ 'l2_policy' ] [ 'l3_policy_id' ] ) #NEWLINE# req = self . new_show_request ( 'l3_policies' , l3p_id , fmt = self . fmt ) #NEWLINE# l3p = self . deserialize ( self . fmt , req . get_response ( self . ext_api ) ) #NEWLINE# self . assertEqual ( 'default' , l3p [ 'l3_policy' ] [ 'name' ] ) #NEWLINE# self . assertEqual ( shared , l3p [ 'l3_policy' ] [ 'shared' ] ) #NEWLINE# self . assertEqual ( 24 , l3p [ 'l3_policy' ] [ 'subnet_prefix_length' ] ) #NEWLINE# l2p2 = self . create_l2_policy ( ) #NEWLINE# l2p2_id = l2p2 [ 'l2_policy' ] [ 'id' ] #NEWLINE# self . assertEqual ( l3p_id , l2p2 [ 'l2_policy' ] [ 'l3_policy_id' ] ) #NEWLINE# req = self . new_delete_request ( 'l2_policies' , l2p1_id ) #NEWLINE# res = req . get_response ( self . ext_api ) #NEWLINE# self . assertEqual ( webob . exc . HTTPNoContent . code , res . status_int ) #NEWLINE# req = self . new_show_request ( 'l3_policies' , l3p_id , fmt = self . fmt ) #NEWLINE# res = req . get_response ( self . ext_api ) #NEWLINE# self . assertEqual ( webob . exc . HTTPOk . code , res . status_int ) #NEWLINE# req = self . new_delete_request ( 'l2_policies' , l2p2_id ) #NEWLINE# res = req . get_response ( self . ext_api ) #NEWLINE# self . assertEqual ( webob . exc . HTTPNoContent . code , res . status_int ) #NEWLINE# req = self . new_show_request ( 'l3_policies' , l3p_id , fmt = self . fmt ) #NEWLINE# res = req . get_response ( self . ext_api ) #NEWLINE# self . assertEqual ( webob . exc . HTTPNotFound . code , res . status_int )