Fixed Replacement test
This commit is contained in:
parent
07a8c4987a
commit
25703f8c53
|
@ -59,6 +59,7 @@ class _ReplaceBase:
|
|||
lst = []
|
||||
for rep in getattr(options, self.optionName):
|
||||
fpatt, rex, s = parse_hook(rep)
|
||||
|
||||
flt = flowfilter.parse(fpatt)
|
||||
if not flt:
|
||||
raise exceptions.OptionsError(
|
||||
|
|
|
@ -120,7 +120,6 @@ class Options(optmanager.OptManager):
|
|||
the separator can be any character.
|
||||
"""
|
||||
)
|
||||
|
||||
self.add_option(
|
||||
"server_replay_use_headers", Sequence[str], [],
|
||||
"Request headers to be considered during replay."
|
||||
|
|
|
@ -72,7 +72,7 @@ class TestUpstreamProxy(tservers.HTTPUpstreamProxyTest):
|
|||
|
||||
class TestReplaceFile:
|
||||
def test_simple(self):
|
||||
r = replace.ReplaceFile()
|
||||
r = replace.Replace()
|
||||
with tutils.tmpdir() as td:
|
||||
rp = os.path.join(td, "replacement")
|
||||
with open(rp, "w") as f:
|
||||
|
@ -80,10 +80,10 @@ class TestReplaceFile:
|
|||
with taddons.context() as tctx:
|
||||
tctx.configure(
|
||||
r,
|
||||
replacement_files = [
|
||||
"/~q/foo/" + rp,
|
||||
"/~s/foo/" + rp,
|
||||
"/~b nonexistent/nonexistent/nonexistent",
|
||||
replacements = [
|
||||
"/~q/foo/@" + rp,
|
||||
"/~s/foo/@" + rp,
|
||||
"/~b nonexistent/nonexistent/@nonexistent",
|
||||
]
|
||||
)
|
||||
f = tflow.tflow()
|
||||
|
|
Loading…
Reference in New Issue