Fix generated values in request path specification.
This commit is contained in:
parent
0c9cfb3f38
commit
8c6cc8140c
|
@ -136,7 +136,7 @@ v_literal = pp.MatchFirst(
|
||||||
v_naked_literal = pp.MatchFirst(
|
v_naked_literal = pp.MatchFirst(
|
||||||
[
|
[
|
||||||
v_literal,
|
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
|
@classmethod
|
||||||
def expr(klass):
|
def expr(klass):
|
||||||
e = NakedValue.copy()
|
e = Value | NakedValue
|
||||||
return e.setParseAction(lambda x: klass(*x))
|
return e.setParseAction(lambda x: klass(*x))
|
||||||
|
|
||||||
def values(self, settings):
|
def values(self, settings):
|
||||||
|
|
|
@ -169,6 +169,7 @@ class TestMisc:
|
||||||
v2 = v.freeze({})
|
v2 = v.freeze({})
|
||||||
v3 = v2.freeze({})
|
v3 = v2.freeze({})
|
||||||
assert v2.value.val == v3.value.val
|
assert v2.value.val == v3.value.val
|
||||||
|
assert len(v2.value.val) == 100
|
||||||
|
|
||||||
s = v.spec()
|
s = v.spec()
|
||||||
assert s == v.expr().parseString(s)[0].spec()
|
assert s == v.expr().parseString(s)[0].spec()
|
||||||
|
@ -488,6 +489,10 @@ class TestRequest:
|
||||||
r = language.parse_request({}, "GET:/:b@100").freeze({})
|
r = language.parse_request({}, "GET:/:b@100").freeze({})
|
||||||
assert len(r.spec()) > 100
|
assert len(r.spec()) > 100
|
||||||
|
|
||||||
|
def test_path_generator(self):
|
||||||
|
r = language.parse_request({}, "GET:@100").freeze({})
|
||||||
|
assert len(r.spec()) > 100
|
||||||
|
|
||||||
|
|
||||||
class TestWriteValues:
|
class TestWriteValues:
|
||||||
def test_send_chunk(self):
|
def test_send_chunk(self):
|
||||||
|
|
Loading…
Reference in New Issue