Ticket #371 (closed defect: fixed)

Opened 3 years ago

Last modified 18 months ago

TestApp doesn't have a head() method (for HTTP HEAD)

Reported by: greut Owned by: maluke
Priority: high Milestone: 1.4.1
Component: webtest Version: svn-trunk
Severity: normal Keywords: webtest, head, testapp
Cc:

Description

>>> app = TestApp(...)
>>> app.head("/")
AttributeError: 'TestApp' object has no attribute 'head'

Thanks!

Attachments

pythonpaste_371_head.patch Download (2.0 KB) - added by greut 3 years ago.
providing a .head method
ticket_371_webob.patch Download (1.2 KB) - added by greut 2 years ago.
patching webob
ticket_371_webtest.patch Download (3.7 KB) - added by greut 2 years ago.
patching webtest

Change History

Changed 3 years ago by greut

providing a .head method

Changed 3 years ago by greut

I cannot get the debug_app to behave correctly.

The Content-Length entity-header field indicates the size of the entity-body, in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET.

the content-size is changed to 0 when the body is empty.

Changed 2 years ago by greut

  • component changed from paste to webob

I had to patch both WebOb and WebTest to get this working, patches are following.

Changed 2 years ago by greut

patching webob

Changed 2 years ago by greut

patching webtest

Changed 2 years ago by maluke

  • component changed from webob to webtest

Changed 2 years ago by GothAlice

  • priority changed from normal to high

Please get the webob patch applied for the earliest release possible; the standard defines that all headers should be from from the GET request with the body stripped; webob resets the content-length to zero. This ticket has existed for four months now.

My unit tests are very unhappy if the Content-Length is ever zero for a HEAD request. :(

Changed 2 years ago by maluke

can you provide a test case for incorrect webob behavior? (make sure it's specifically a webob problem)

Changed 2 years ago by maluke

  • owner changed from ianb to maluke
  • status changed from new to assigned

OK, I have a couple test cases, will apply fixes soon.

Changed 2 years ago by maluke

WebOb? changes are in ( http://bitbucket.org/ianb/webob/changeset/eec515fceb5b/), however I *will not* do any related work on WebTest? or Paste.

Changed 2 years ago by GothAlice

That's great, thanks for the rapid turn-around after my comment! This should probably have been separate tickets for the various components. Any ETA for a Pypi release?

Changed 18 months ago by ianb

  • status changed from assigned to closed
  • resolution set to fixed

applied in webtest

Note: See TracTickets for help on using tickets.