dulwich.tests.test_web module

Tests for the Git HTTP server.

class dulwich.tests.test_web.DumbHandlersTestCase(methodName='runTest')

Bases: dulwich.tests.test_web.WebTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_get_idx_file()
test_get_info_packs()
test_get_info_refs()
test_get_loose_object()
test_get_loose_object_error()
test_get_loose_object_missing()
test_get_pack_file()
test_get_text_file()
test_send_file()
test_send_file_buffered()
test_send_file_error()
test_send_file_not_found()
class dulwich.tests.test_web.GunzipTestCase(methodName='runTest')

Bases: dulwich.tests.test_web.HTTPGitApplicationTestCase

TestCase for testing the GunzipFilter, ensuring the wsgi.input is correctly decompressed and headers are corrected.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

example_text = 'TestCase for testing the GunzipFilter, ensuring the wsgi.input\n is correctly decompressed and headers are corrected.\n '
setUp()

Hook method for setting up the test fixture before exercising it.

test_call()
test_call_no_seek()

This ensures that the gunzipping code doesn’t require any methods on ‘wsgi.input’ except for ‘.read()’. (In particular, it shouldn’t require ‘.seek()’. See https://github.com/jelmer/dulwich/issues/140.)

test_call_no_working_seek()

Similar to ‘test_call_no_seek’, but this time the methods are available (but defunct). See https://github.com/jonashaag/klaus/issues/154.

class dulwich.tests.test_web.HTTPGitApplicationTestCase(methodName='runTest')

Bases: dulwich.tests.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()

Hook method for setting up the test fixture before exercising it.

test_call()
test_fallback_app()
class dulwich.tests.test_web.HTTPGitRequestTestCase(methodName='runTest')

Bases: dulwich.tests.test_web.WebTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_forbidden()
test_not_found()
test_respond()
test_respond_ok()
class dulwich.tests.test_web.LengthLimitedFileTestCase(methodName='runTest')

Bases: dulwich.tests.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_cutoff()
test_multiple_reads()
test_no_cutoff()
class dulwich.tests.test_web.MinimalistWSGIInputStream(data)

Bases: object

WSGI input stream with no ‘seek()’ and ‘tell()’ methods.

read(howmuch)
class dulwich.tests.test_web.MinimalistWSGIInputStream2(data)

Bases: dulwich.tests.test_web.MinimalistWSGIInputStream

WSGI input stream with no working ‘seek()’ and ‘tell()’ methods.

seek(pos)
tell()
class dulwich.tests.test_web.SmartHandlersTestCase(methodName='runTest')

Bases: dulwich.tests.test_web.WebTestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_get_info_refs()
test_get_info_refs_unknown()
test_handle_service_request()
test_handle_service_request_empty_length()
test_handle_service_request_unknown()
test_handle_service_request_with_length()
class dulwich.tests.test_web.TestHTTPGitRequest(*args, **kwargs)

Bases: dulwich.web.HTTPGitRequest

HTTPGitRequest with overridden methods to help test caching.

cache_forever()

Set the response to be cached forever by the client.

nocache()

Set the response to never be cached by the client.

class dulwich.tests.test_web.WebTestCase(methodName='runTest')

Bases: dulwich.tests.TestCase

Base TestCase with useful instance vars and utility functions.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

assertContentTypeEquals(expected)
setUp()

Hook method for setting up the test fixture before exercising it.