← Back to team overview

dulwich-users team mailing list archive

Re: [PATCH 13/13] web: Use correct result MIME types.

 

On Mon, 2011-08-01 at 10:28 -0700, dborowitz@xxxxxxxxxx wrote:
> From: Dave Borowitz <dborowitz@xxxxxxxxxx>
> 
> We inherited the incorrect type from C git, which has since fixed this
> bug. The C git client doesn't actually check the MIME type, but other
> clients, such as JGit, may.
> 
> For more details, see:
> http://repo.or.cz/w/git.git/commitdiff/8efa5f629efb9a8af48619ee90dee02343e0f19d
> http://code.google.com/p/support/issues/detail?id=5576
I get test failures with this patch:

FAIL: test_handle_service_request
(dulwich.tests.test_web.SmartHandlersTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "dulwich/tests/test_web.py", line 325, in
test_handle_service_request
    self._run_handle_service_request()
  File "dulwich/tests/test_web.py", line 319, in
_run_handle_service_request

self.assertContentTypeEquals('application/x-git-upload-pack-response')
  File "dulwich/tests/test_web.py", line 101, in assertContentTypeEquals
    self.assertTrue(('Content-Type', expected) in self._headers,
self._headers)
AssertionError: [('Content-Type',
'application/x-git-upload-pack-result')]

======================================================================
FAIL: test_handle_service_request_empty_length
(dulwich.tests.test_web.SmartHandlersTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "dulwich/tests/test_web.py", line 331, in
test_handle_service_request_empty_length
    self._run_handle_service_request(content_length='')
  File "dulwich/tests/test_web.py", line 319, in
_run_handle_service_request

self.assertContentTypeEquals('application/x-git-upload-pack-response')
  File "dulwich/tests/test_web.py", line 101, in assertContentTypeEquals
    self.assertTrue(('Content-Type', expected) in self._headers,
self._headers)
AssertionError: [('Content-Type',
'application/x-git-upload-pack-result')]

======================================================================
FAIL: test_handle_service_request_with_length
(dulwich.tests.test_web.SmartHandlersTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "dulwich/tests/test_web.py", line 328, in
test_handle_service_request_with_length
    self._run_handle_service_request(content_length='3')
  File "dulwich/tests/test_web.py", line 319, in
_run_handle_service_request

self.assertContentTypeEquals('application/x-git-upload-pack-response')
  File "dulwich/tests/test_web.py", line 101, in assertContentTypeEquals
    self.assertTrue(('Content-Type', expected) in self._headers,
self._headers)
AssertionError: [('Content-Type',
'application/x-git-upload-pack-result')]

It looks like the tests need to be updated to check for the actually
expected behaviour. (-response rather than -result).

Cheers,

Jelmer

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups

References