#NEWLINE# def test_context_attributes( self ) : #NEWLINE# #INDENT# plugin_context = n_context . get_admin_context ( ) #NEWLINE# profile = self . _create_service_profile ( service_type = 'LOADBALANCER' , vendor = self . SERVICE_PROFILE_VENDOR ) [ 'service_profile' ] #NEWLINE# node = self . create_servicechain_node ( service_profile_id = profile [ 'id' ] , config = self . DEFAULT_LB_CONFIG ) [ 'servicechain_node' ] #NEWLINE# spec = self . create_servicechain_spec ( nodes = [ node [ 'id' ] ] ) [ 'servicechain_spec' ] #NEWLINE# provider = self . create_policy_target_group ( ) [ 'policy_target_group' ] #NEWLINE# self . create_policy_target_group ( ) #NEWLINE# management = self . create_policy_target_group ( service_management = True , is_admin_context = True ) [ 'policy_target_group' ] #NEWLINE# classifier = self . create_policy_classifier ( ) [ 'policy_classifier' ] #NEWLINE# instance = self . create_servicechain_instance ( provider_ptg_id = provider [ 'id' ] , consumer_ptg_id = 'N/A' , servicechain_specs = [ spec [ 'id' ] ] , classifier_id = classifier [ 'id' ] ) [ 'servicechain_instance' ] #NEWLINE# ctx = ncp_context . get_node_driver_context ( self . plugin , plugin_context , instance , node ) #NEWLINE# self . assertIsNotNone ( ctx . gbp_plugin ) #NEWLINE# self . assertIsNotNone ( ctx . sc_plugin ) #NEWLINE# self . assertIsNotNone ( ctx . core_plugin ) #NEWLINE# self . assertIsNotNone ( ctx . plugin_context ) #NEWLINE# self . assertIsNotNone ( ctx . plugin_session ) #NEWLINE# self . assertIsNotNone ( ctx . session ) #NEWLINE# self . assertIsNotNone ( ctx . admin_context ) #NEWLINE# self . assertIsNotNone ( ctx . admin_session ) #NEWLINE# del ctx . current_profile [ 'nodes' ] #NEWLINE# self . assertEqual ( ctx . current_profile , profile ) #NEWLINE# self . assertEqual ( instance [ 'id' ] , ctx . instance [ 'id' ] ) #NEWLINE# self . assertEqual ( provider [ 'id' ] , ctx . provider [ 'id' ] ) #NEWLINE# self . assertIsNone ( ctx . consumer ) #NEWLINE# self . assertEqual ( management [ 'id' ] , ctx . management [ 'id' ] ) #NEWLINE# self . assertEqual ( [ spec [ 'id' ] ] , [ x [ 'id' ] for x in ctx . relevant_specs ] ) #NEWLINE# self . assertIsNone ( ctx . original_node ) #NEWLINE# self . assertEqual ( 0 , len ( ctx . get_service_targets ( ) ) )