#NEWLINE# @ test . idempotent_id ( '8a59b00b-3e9c-4787-92f8-93a5cdf5e378' ) #NEWLINE# def test_rule_create( self ) : #NEWLINE# #INDENT# policy = self . create_qos_policy ( name = 'test-policy' , description = 'test policy' , shared = False ) #NEWLINE# rule = self . admin_client . create_dscp_marking_rule ( policy [ 'id' ] , self . VALID_DSCP_MARK1 ) [ 'dscp_marking_rule' ] #NEWLINE# retrieved_rule = self . admin_client . show_dscp_marking_rule ( policy [ 'id' ] , rule [ 'id' ] ) #NEWLINE# retrieved_rule = retrieved_rule [ 'dscp_marking_rule' ] #NEWLINE# self . assertEqual ( policy [ 'id' ] , retrieved_rule [ 'id' ] ) #NEWLINE# self . assertEqual ( self . VALID_DSCP_MARK1 , retrieved_rule [ 'dscp_mark' ] ) #NEWLINE# rules = self . admin_client . list_dscp_marking_rules ( policy [ 'id' ] ) #NEWLINE# rules = rules [ 'dscp_marking_rules' ] #NEWLINE# rules_ids = [ r [ 'id' ] for r in rules ] #NEWLINE# self . assertIn ( rule [ 'id' ] , rules_ids ) #NEWLINE# retrieved_policy = self . admin_client . show_qos_policy ( policy [ 'id' ] ) #NEWLINE# policy_rules = retrieved_policy [ 'policy' ] [ 'rules' ] #NEWLINE# self . assertEqual ( 1 , len ( policy_rules ) ) #NEWLINE# self . assertEqual ( rule [ 'id' ] , policy_rules [ 0 ] [ 'id' ] ) #NEWLINE# self . assertEqual ( qos_consts . RULE_TYPE_DSCP_MARK , policy_rules [ 0 ] [ 'type' ] )