Fix location for contrib har_dump.py in its test (#4424)

To run the test, I had to copy `conftest.py` to examples.

    cp test/conftest.py examples
    pytest examples/contrib/test_har_dump.py

This fixes the `fixture 'tdata' not found` error.
This commit is contained in:
Anatoli Babenia 2021-02-03 20:52:56 +03:00 committed by GitHub
parent 578514d4f2
commit 00f718e6c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ class TestHARDump:
def test_simple(self, tmpdir, tdata): def test_simple(self, tmpdir, tdata):
with taddons.context() as tctx: with taddons.context() as tctx:
a = tctx.script(tdata.path("../examples/complex/har_dump.py")) a = tctx.script(tdata.path("../examples/contrib/har_dump.py"))
path = str(tmpdir.join("somefile")) path = str(tmpdir.join("somefile"))
tctx.configure(a, hardump=path) tctx.configure(a, hardump=path)
tctx.invoke(a, "response", self.flow()) tctx.invoke(a, "response", self.flow())
@ -32,7 +32,7 @@ class TestHARDump:
def test_base64(self, tmpdir, tdata): def test_base64(self, tmpdir, tdata):
with taddons.context() as tctx: with taddons.context() as tctx:
a = tctx.script(tdata.path("../examples/complex/har_dump.py")) a = tctx.script(tdata.path("../examples/contrib/har_dump.py"))
path = str(tmpdir.join("somefile")) path = str(tmpdir.join("somefile"))
tctx.configure(a, hardump=path) tctx.configure(a, hardump=path)
@ -46,7 +46,7 @@ class TestHARDump:
def test_format_cookies(self, tdata): def test_format_cookies(self, tdata):
with taddons.context() as tctx: with taddons.context() as tctx:
a = tctx.script(tdata.path("../examples/complex/har_dump.py")) a = tctx.script(tdata.path("../examples/contrib/har_dump.py"))
CA = cookies.CookieAttrs CA = cookies.CookieAttrs
@ -65,7 +65,7 @@ class TestHARDump:
def test_binary(self, tmpdir, tdata): def test_binary(self, tmpdir, tdata):
with taddons.context() as tctx: with taddons.context() as tctx:
a = tctx.script(tdata.path("../examples/complex/har_dump.py")) a = tctx.script(tdata.path("../examples/contrib/har_dump.py"))
path = str(tmpdir.join("somefile")) path = str(tmpdir.join("somefile"))
tctx.configure(a, hardump=path) tctx.configure(a, hardump=path)