File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,8 @@ class SerializableTokenCache(TokenCache):
207207 Indicates whether the cache state has changed since last
208208 :func:`~serialize` or :func:`~deserialize` call.
209209 """
210+ has_state_changed = False
211+
210212 def add (self , event , ** kwargs ):
211213 super (SerializableTokenCache , self ).add (event , ** kwargs )
212214 self .has_state_changed = True
Original file line number Diff line number Diff line change @@ -106,6 +106,12 @@ def setUp(self):
106106 }
107107 """ )
108108
109+ def test_has_state_changed (self ):
110+ cache = SerializableTokenCache ()
111+ self .assertFalse (cache .has_state_changed )
112+ cache .add ({}) # An NO-OP add() still counts as a state change. Good enough.
113+ self .assertTrue (cache .has_state_changed )
114+
109115 def tearDown (self ):
110116 state = self .cache .serialize ()
111117 logger .debug ("serialize() = %s" , state )
You can’t perform that action at this time.
0 commit comments