Fix generated values in request path specification.

This commit is contained in:
Aldo Cortesi 2012-10-31 09:48:55 +13:00
parent 0c9cfb3f38
commit 8c6cc8140c
2 changed files with 7 additions and 2 deletions

View File

@ -136,7 +136,7 @@ v_literal = pp.MatchFirst(
v_naked_literal = pp.MatchFirst(
[
v_literal,
pp.Word("".join(i for i in pp.printables if i not in ",:\n"))
pp.Word("".join(i for i in pp.printables if i not in ",:\n@\'\""))
]
)
@ -479,7 +479,7 @@ class Path(_Component):
@classmethod
def expr(klass):
e = NakedValue.copy()
e = Value | NakedValue
return e.setParseAction(lambda x: klass(*x))
def values(self, settings):

View File

@ -169,6 +169,7 @@ class TestMisc:
v2 = v.freeze({})
v3 = v2.freeze({})
assert v2.value.val == v3.value.val
assert len(v2.value.val) == 100
s = v.spec()
assert s == v.expr().parseString(s)[0].spec()
@ -488,6 +489,10 @@ class TestRequest:
r = language.parse_request({}, "GET:/:b@100").freeze({})
assert len(r.spec()) > 100
def test_path_generator(self):
r = language.parse_request({}, "GET:@100").freeze({})
assert len(r.spec()) > 100
class TestWriteValues:
def test_send_chunk(self):