options.nopop -> options.server_replay_nopop

This commit is contained in:
Aldo Cortesi 2016-09-10 10:07:55 +12:00
parent 5ebe8c1bc8
commit 8677e91074
5 changed files with 10 additions and 11 deletions

View File

@ -78,7 +78,7 @@ class ServerPlayback(object):
"""
hsh = self._hash(request)
if hsh in self.flowmap:
if self.options.nopop:
if self.options.server_replay_nopop:
return self.flowmap[hsh][0]
else:
ret = self.flowmap[hsh].pop(0)
@ -101,8 +101,7 @@ class ServerPlayback(object):
# prefixed with serverplayback_ where appropriate, and playback_ where
# they're shared with client playback.
#
# options.server_replay_use_headers,
# options.nopop,
# options.server_replay_nopop,
# options.replay_ignore_params,
# options.replay_ignore_content,
# options.replay_ignore_payload_params,

View File

@ -233,7 +233,7 @@ def get_common_options(args):
showhost=args.showhost,
outfile=args.outfile,
verbosity=args.verbose,
nopop=args.nopop,
server_replay_nopop=args.server_replay_nopop,
replay_ignore_content=args.replay_ignore_content,
replay_ignore_params=args.replay_ignore_params,
replay_ignore_payload_params=args.replay_ignore_payload_params,
@ -614,7 +614,7 @@ def server_replay(parser):
)
group.add_argument(
"--no-pop",
action="store_true", dest="nopop", default=False,
action="store_true", dest="server_replay_nopop", default=False,
help="Disable response pop from response flow. "
"This makes it possible to replay same response multiple times."
)

View File

@ -149,7 +149,7 @@ class ConnectionItem(urwid.WidgetWrap):
self.master.start_server_playback(
[i.copy() for i in self.master.state.view],
self.master.options.replay_kill_extra, self.master.options.server_replay_use_headers,
False, self.master.options.nopop,
False, self.master.options.server_replay_nopop,
self.master.options.replay_ignore_params,
self.master.options.replay_ignore_content,
self.master.options.replay_ignore_payload_params,
@ -159,7 +159,7 @@ class ConnectionItem(urwid.WidgetWrap):
self.master.start_server_playback(
[self.flow.copy()],
self.master.options.replay_kill_extra, self.master.options.server_replay_use_headers,
False, self.master.options.nopop,
False, self.master.options.server_replay_nopop,
self.master.options.replay_ignore_params,
self.master.options.replay_ignore_content,
self.master.options.replay_ignore_payload_params,

View File

@ -33,7 +33,7 @@ class Options(optmanager.OptManager):
replay_kill_extra=False, # type: bool
keepserving=True, # type: bool
no_server=False, # type: bool
nopop=False, # type: bool
server_replay_nopop=False, # type: bool
refresh_server_playback=False, # type: bool
rfile=None, # type: Optional[str]
scripts=(), # type: Sequence[str]
@ -91,7 +91,7 @@ class Options(optmanager.OptManager):
self.keepserving = keepserving
self.replay_kill_extra = replay_kill_extra
self.no_server = no_server
self.nopop = nopop
self.server_replay_nopop = server_replay_nopop
self.refresh_server_playback = refresh_server_playback
self.rfile = rfile
self.scripts = scripts

View File

@ -167,9 +167,9 @@ class TestServerPlayback:
assert not s.next_flow(r)
def test_load_with_nopop(self):
def test_load_with_server_replay_nopop(self):
s = serverplayback.ServerPlayback()
s.configure(options.Options(nopop=True), [])
s.configure(options.Options(server_replay_nopop=True), [])
r = tutils.tflow(resp=True)
r.request.headers["key"] = "one"