Skip to content

Commit

Permalink
Merge pull request #1209 from dufferzafar/pathod-lang-base
Browse files Browse the repository at this point in the history
Python 3 - pathod.language.base
  • Loading branch information
Kriechi committed Jun 4, 2016
2 parents 1c82231 + f45765a commit 2355c29
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion pathod/language/base.py
Expand Up @@ -226,7 +226,7 @@ def get_generator(self, settings):
return generators.FileGenerator(s)

def spec(self):
return "<'%s'" % strutils.bytes_to_escaped_str(self.path)
return "<'%s'" % self.path


TokValue = pp.MatchFirst(
Expand Down
8 changes: 4 additions & 4 deletions test/pathod/test_language_base.py
Expand Up @@ -38,7 +38,7 @@ def test_spec(self):

class TestTokValueLiteral:

def test_espr(self):
def test_expr(self):
v = base.TokValueLiteral("foo")
assert v.expr()
assert v.val == b"foo"
Expand Down Expand Up @@ -132,7 +132,7 @@ def test_access_control(self):
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))

Expand Down Expand Up @@ -207,13 +207,13 @@ class TT(base.FixedLengthValue):
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)

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -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
Expand Down

0 comments on commit 2355c29

Please sign in to comment.