[Checkins] [zopefoundation/zope.app.wsgi] 94d739: Extract FakeResponse.server_protocol attribute

Marius Gedminas noreply at github.com
Thu Jun 6 17:33:46 CEST 2019


  Branch: refs/heads/httpcaller-compat
  Home:   https://github.com/zopefoundation/zope.app.wsgi
  Commit: 94d7396b7d5dd273dfd3458a4007395d3ed99514
      https://github.com/zopefoundation/zope.app.wsgi/commit/94d7396b7d5dd273dfd3458a4007395d3ed99514
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2019-06-06 (Thu, 06 Jun 2019)

  Changed paths:
    M src/zope/app/wsgi/testlayer.py

  Log Message:
  -----------
  Extract FakeResponse.server_protocol attribute

zope.app.testing.functional.http() used to respond with "HTTP/1.1 ...",
zope.app.wsgi.testlayer.http() hardcodes the server protocol as
"HTTP/1.0 ...".

This is annoying when I'm trying to port old large test suites.  Let's
at least make this easier to customize by subclassing and overriding a
single attribute, without having to rewrite the entire method.


  Commit: 711a5120ba5eab704e1ef83fede7fbbb83691632
      https://github.com/zopefoundation/zope.app.wsgi/commit/711a5120ba5eab704e1ef83fede7fbbb83691632
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2019-06-06 (Thu, 06 Jun 2019)

  Changed paths:
    M src/zope/app/wsgi/testlayer.py

  Log Message:
  -----------
  Allow leading spaces in http() requests

zope.app.testing.functional.HTTPCaller allowed you to write

    >>> print http(r"""
    ... GET / HTTP/1.1
    ... Headers: headers etc.
    ... """)

I don't see why zope.app.wsgi.testlayer.http() can't do the same.

This makes porting large ancient test suites easier.


Compare: https://github.com/zopefoundation/zope.app.wsgi/compare/01ccf3ff5d60...711a5120ba5e


More information about the checkins mailing list