mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
Merge branch 'master' of ssh.github.com:mitmproxy/pathod
This commit is contained in:
commit
467ef0c02a
14
.travis.yml
Normal file
14
.travis.yml
Normal file
@ -0,0 +1,14 @@
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
|
||||
install:
|
||||
- "pip install coveralls --use-mirrors"
|
||||
- "pip install nose-cov --use-mirrors"
|
||||
- "pip install -r requirements.txt --use-mirrors"
|
||||
- "pip install --upgrade git+https://github.com/mitmproxy/netlib.git"
|
||||
# command to run tests, e.g. python setup.py test
|
||||
script:
|
||||
- "nosetests --with-cov --cov-report term-missing"
|
||||
after_success:
|
||||
- coveralls
|
@ -1,3 +1,5 @@
|
||||
[![Build Status](https://travis-ci.org/mitmproxy/pathod.png)](https://travis-ci.org/mitmproxy/pathod) [![Coverage Status](https://coveralls.io/repos/mitmproxy/pathod/badge.png)](https://coveralls.io/r/mitmproxy/pathod)
|
||||
|
||||
__pathod__ is a collection of pathological tools for testing and torturing HTTP
|
||||
clients and servers. The project has three components:
|
||||
|
||||
|
@ -182,7 +182,7 @@ class FileGenerator:
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
self.fp = file(path, "rb")
|
||||
self.map = mmap.mmap(self.fp.fileno(), 0, prot=mmap.PROT_READ)
|
||||
self.map = mmap.mmap(self.fp.fileno(), 0, access=mmap.ACCESS_READ)
|
||||
|
||||
def __len__(self):
|
||||
return len(self.map)
|
||||
|
10
requirements.txt
Normal file
10
requirements.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Flask>=0.10.1
|
||||
Jinja2>=2.7.1
|
||||
MarkupSafe>=0.18
|
||||
Werkzeug>=0.9.4
|
||||
itsdangerous>=0.23
|
||||
nose>=1.3.0
|
||||
pyOpenSSL>=0.13.1
|
||||
pyasn1>=0.1.7
|
||||
requests>=2.1.0
|
||||
netlib>=0.9.2
|
@ -95,9 +95,8 @@ class TestValueFile:
|
||||
v = language.Value.parseString("<path")[0]
|
||||
with tutils.tmpdir() as t:
|
||||
p = os.path.join(t, "path")
|
||||
f = open(p, "wb")
|
||||
f.write("x"*10000)
|
||||
f.close()
|
||||
with open(p, "wb") as f:
|
||||
f.write("x" * 10000)
|
||||
|
||||
assert v.get_generator(dict(staticdir=t))
|
||||
|
||||
@ -152,6 +151,7 @@ class TestMisc:
|
||||
assert g[-1] == "x"
|
||||
assert g[0:5] == "xxxxx"
|
||||
assert repr(g)
|
||||
del g # remove all references to FileGenerator instance to close the file handle.
|
||||
|
||||
def test_value(self):
|
||||
assert language.Value.parseString("'val'")[0].val == "val"
|
||||
@ -697,7 +697,10 @@ class TestResponse:
|
||||
assert r.actions[0].spec() == "pr,10"
|
||||
|
||||
def test_parse_stress(self):
|
||||
r = language.parse_response({}, "400:b@100g")
|
||||
# While larger values are known to work on linux,
|
||||
# len() technically returns an int and a python 2.7 int on windows has 32bit precision.
|
||||
# Therefore, we should keep the body length < 2147483647 bytes in our tests.
|
||||
r = language.parse_response({}, "400:b@1g")
|
||||
assert r.length({})
|
||||
|
||||
def test_spec(self):
|
||||
|
Loading…
Reference in New Issue
Block a user