Fixed Replacement test

This commit is contained in:
Ujjwal Verma 2017-03-09 23:33:11 +05:30
parent 07a8c4987a
commit 25703f8c53
3 changed files with 6 additions and 6 deletions

View File

@ -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(

View File

@ -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."

View File

@ -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()