fix revert of duplicated flows
This commit is contained in:
parent
4cb96dedd0
commit
e6e28c2ac3
|
@ -99,6 +99,7 @@ class Flow(stateobject.StateObject):
|
|||
return d
|
||||
|
||||
def set_state(self, state):
|
||||
state = state.copy()
|
||||
state.pop("version")
|
||||
if "backup" in state:
|
||||
self._backup = state.pop("backup")
|
||||
|
|
|
@ -56,6 +56,7 @@ class HTTPRequest(http.Request):
|
|||
return state
|
||||
|
||||
def set_state(self, state):
|
||||
state = state.copy()
|
||||
self.is_replay = state.pop("is_replay")
|
||||
super().set_state(state)
|
||||
|
||||
|
|
|
@ -84,6 +84,17 @@ class TestSerialize:
|
|||
with pytest.raises(Exception, match="version"):
|
||||
list(r.stream())
|
||||
|
||||
def test_copy(self):
|
||||
"""
|
||||
_backup may be shared across instances. That should not raise errors.
|
||||
"""
|
||||
f = tflow.tflow()
|
||||
f.backup()
|
||||
f.request.path = "/foo"
|
||||
f2 = f.copy()
|
||||
f2.revert()
|
||||
f.revert()
|
||||
|
||||
|
||||
class TestFlowMaster:
|
||||
def test_load_flow_reverse(self):
|
||||
|
|
Loading…
Reference in New Issue