aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-06-04 15:57:22 +0200
committerThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-06-04 15:57:22 +0200
commit2355c29c0ef59019950da3a0410cd91bfeedb872 (patch)
tree58a569bc4e491708fa7bcc4ceea9306d942cbc36
parent1c8223112900c26386560677134092cab5dbeea6 (diff)
parentf45765a236f058a9d1eece7e5a5216e6fbcdecbe (diff)
downloadmitmproxy-2355c29c0ef59019950da3a0410cd91bfeedb872.tar.gz
mitmproxy-2355c29c0ef59019950da3a0410cd91bfeedb872.tar.bz2
mitmproxy-2355c29c0ef59019950da3a0410cd91bfeedb872.zip
Merge pull request #1209 from dufferzafar/pathod-lang-base
Python 3 - pathod.language.base
-rw-r--r--.travis.yml4
-rw-r--r--pathod/language/base.py2
-rw-r--r--test/pathod/test_language_base.py8
-rw-r--r--tox.ini2
4 files changed, 8 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index bdfb4655..5f065d53 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,9 +22,9 @@ matrix:
git:
depth: 9999999
- python: 3.5
- env: SCOPE="netlib test/mitmproxy/script test/pathod/test_utils.py test/pathod/test_log.py test/pathod/test_language_generators.py test/pathod/test_language_writer.py"
+ env: SCOPE="netlib test/mitmproxy/script test/pathod/test_utils.py test/pathod/test_log.py test/pathod/test_language_generators.py test/pathod/test_language_writer.py test/pathod/test_language_base.py"
- python: 3.5
- env: SCOPE="netlib test/mitmproxy/script test/pathod/test_utils.py test/pathod/test_log.py test/pathod/test_language_generators.py test/pathod/test_language_writer.py" NO_ALPN=1
+ env: SCOPE="netlib test/mitmproxy/script test/pathod/test_utils.py test/pathod/test_log.py test/pathod/test_language_generators.py test/pathod/test_language_writer.py test/pathod/test_language_base.py" NO_ALPN=1
- python: 2.7
env: DOCS=1
script: 'cd docs && make html'
diff --git a/pathod/language/base.py b/pathod/language/base.py
index 11ee0623..1369a3c7 100644
--- a/pathod/language/base.py
+++ b/pathod/language/base.py
@@ -226,7 +226,7 @@ class TokValueFile(Token):
return generators.FileGenerator(s)
def spec(self):
- return "<'%s'" % strutils.bytes_to_escaped_str(self.path)
+ return "<'%s'" % self.path
TokValue = pp.MatchFirst(
diff --git a/test/pathod/test_language_base.py b/test/pathod/test_language_base.py
index 47e51bb0..075dc2b8 100644
--- a/test/pathod/test_language_base.py
+++ b/test/pathod/test_language_base.py
@@ -38,7 +38,7 @@ class TestTokValueNakedLiteral:
class TestTokValueLiteral:
- def test_espr(self):
+ def test_expr(self):
v = base.TokValueLiteral("foo")
assert v.expr()
assert v.val == b"foo"
@@ -132,7 +132,7 @@ class TestTokValueFile:
with tutils.tmpdir() as t:
p = os.path.join(t, "path")
with open(p, "wb") as f:
- f.write("x" * 10000)
+ f.write(b"x" * 10000)
assert v.get_generator(language.Settings(staticdir=t))
@@ -207,13 +207,13 @@ class TestMisc:
p = os.path.join(t, "path")
s = base.Settings(staticdir=t)
with open(p, "wb") as f:
- f.write("a" * 20)
+ f.write(b"a" * 20)
v = e.parseString("m<path")[0]
tutils.raises("invalid value length", v.values, s)
p = os.path.join(t, "path")
with open(p, "wb") as f:
- f.write("a" * 4)
+ f.write(b"a" * 4)
v = e.parseString("m<path")[0]
assert v.values(s)
diff --git a/tox.ini b/tox.ini
index b01de128..f94dfb49 100644
--- a/tox.ini
+++ b/tox.ini
@@ -8,7 +8,7 @@ deps = -rrequirements.txt
commands = py.test -n 8 --timeout 60 ./test
[testenv:py35]
-commands = py.test -n 8 --timeout 60 test/netlib test/mitmproxy/script test/pathod/test_utils.py test/pathod/test_log.py test/pathod/test_language_generators.py test/pathod/test_language_writer.py
+commands = py.test -n 8 --timeout 60 test/netlib test/mitmproxy/script test/pathod/test_utils.py test/pathod/test_log.py test/pathod/test_language_generators.py test/pathod/test_language_writer.py test/pathod/test_language_base.py
[testenv:lint]
deps = flake8