APIs with captures are rendered to syntactically invalid Python
Closed this issue · 0 comments
exarkun commented
Part of the test suite which is commented out fails now if tweaked slightly to fix a type error:
it "should build urls properly with / separator" $ do
let pyUrl = makePyUrl customOptions (UnTypedPythonRequest req) " "
pyUrl `shouldBe` "\"urlForRequesting:9000/login-with-path-var-and-header/{id}/{Name}/{hungrig}\""
<> withFormattedCaptures " " pathParts
Failures:
test/Servant/PY/InternalSpec.hs:131:7:
1) Servant.PY.Internal.Servant.PY.Internal.Internal, functions that operate on Req objects, should build urls properly with / separator
expected: "\"urlForRequesting:9000/login-with-path-var-and-header/{id}/{Name}/{hungrig}\".format(\n id=parse.quote(str(id)),\n Name=parse.quote(str(Name)),\n hungrig=parse.quote(str(hungrig)))"
but got: "\"urlForRequesting:9000/login-with-path-var-and-header/{id}/{Name}/{hungrig}\".format(\n id=parse.quote(str(id)),\n Name=parse.quote(str(Name)),\n hungrig=parse.quote(str(hungrig)))\""