From 34f5f5a5c185517b6ddfdff14a17bc919e296d75 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 16 Dec 2013 03:58:46 +0100 Subject: [PATCH 1/2] add travis CI file & requirements.txt --- .travis.yml | 14 ++++++++++++++ requirements.txt | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .travis.yml create mode 100644 requirements.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..920563f53 --- /dev/null +++ b/.travis.yml @@ -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 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..73ed126ba --- /dev/null +++ b/requirements.txt @@ -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 \ No newline at end of file From e0d376381efa3394e23ed60283dc45b7893e8e1e Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 16 Dec 2013 04:47:29 +0100 Subject: [PATCH 2/2] fix windows compatibility --- README.mkd | 2 ++ libpathod/language.py | 2 +- test/test_language.py | 11 +++++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.mkd b/README.mkd index 471ff1060..01b92fcf7 100644 --- a/README.mkd +++ b/README.mkd @@ -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: diff --git a/libpathod/language.py b/libpathod/language.py index 5cce6fdeb..4c1a49773 100644 --- a/libpathod/language.py +++ b/libpathod/language.py @@ -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) diff --git a/test/test_language.py b/test/test_language.py index 18865761c..5e9176abc 100644 --- a/test/test_language.py +++ b/test/test_language.py @@ -95,9 +95,8 @@ class TestValueFile: v = language.Value.parseString("