File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -430,16 +430,26 @@ class Disposition:
430430 "custom_rule", "block_list", and "default". If you do not have custom
431431 rules set up, ``None`` will be returned.
432432
433+ :type: str | None
434+
435+ .. attribute:: rule_label
436+
437+ The label of the custom rule that was triggered. If you do not have
438+ custom rule set up, or the custom rule that was triggered does not have a
439+ label, ``None`` will be returned.
440+
433441 :type: str | None
434442 """
435443
436444 action : Optional [str ]
437445 reason : Optional [str ]
446+ rule_label : Optional [str ]
438447
439448 __slots__ = ()
440449 _fields = {
441450 "action" : None ,
442451 "reason" : None ,
452+ "rule_label" : None ,
443453 }
444454
445455
Original file line number Diff line number Diff line change @@ -99,10 +99,13 @@ def test_device(self):
9999 self .assertEqual (local_time , device .local_time )
100100
101101 def test_disposition (self ):
102- disposition = Disposition ({"action" : "accept" , "reason" : "default" })
102+ disposition = Disposition (
103+ {"action" : "accept" , "reason" : "default" , "rule_label" : "custom rule label" }
104+ )
103105
104106 self .assertEqual ("accept" , disposition .action )
105107 self .assertEqual ("default" , disposition .reason )
108+ self .assertEqual ("custom rule label" , disposition .rule_label )
106109
107110 def test_email (self ):
108111 first_seen = "2016-01-01"
You can’t perform that action at this time.
0 commit comments