dulwich.tests.test_objects module

Tests for git base objects.

class dulwich.tests.test_objects.BlobReadTests(methodName='runTest')

Bases: TestCase

Test decompression of blobs

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.

commit(sha)
get_blob(sha)

Return the blob named sha from the test data dir

get_sha_file(cls, base, sha)
get_tag(sha)
get_tree(sha)
test_chunks()
test_create_blob_from_string()
test_decompress_simple_blob()
test_eq()
test_hash()
test_legacy_from_file()
test_legacy_from_file_compression_level()
test_parse_empty_blob_object()
test_parse_legacy_blob()
test_read_commit_from_file()
test_read_commit_no_parents()
test_read_commit_two_parents()
test_read_tag_from_file()
test_read_tree_from_file()
test_read_tree_from_file_parse_count()
test_set_chunks()
test_splitlines()
test_stub_sha()
class dulwich.tests.test_objects.CheckTests(methodName='runTest')

Bases: 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_check_hexsha()
test_check_identity()
class dulwich.tests.test_objects.CommitParseTests(methodName='runTest')

Bases: ShaFileCheckTests

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.

make_commit_lines(tree=b'd80c186a03f423a81b39df39dc87fd269736ca86', parents=[b'ab64bbdcc51b170d21588e5c5d391ee5c0c96dfd', b'4cffe90e0a41ad3f5190079d7c8f036bde29cbe6'], author=b'James Westby <jw+debian@jameswestby.net> 1174773719 +0000', committer=b'James Westby <jw+debian@jameswestby.net> 1174773719 +0000', encoding=None, message=b'Merge ../b\n', extra=None)
make_commit_text(**kwargs)
test_check()
test_check_commit_with_overflow_date()

Date with overflow should raise an ObjectFormatException when checked

test_check_commit_with_unparseable_time()
test_check_duplicates()
test_check_order()
test_custom()
test_encoding()
test_mangled_author_line()

Mangled author line should successfully parse

test_parse_gpgsig()
test_parse_header_trailing_newline()
test_simple()
class dulwich.tests.test_objects.CommitSerializationTests(methodName='runTest')

Bases: 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.

make_commit(**kwargs)
test_deserialize()
test_deserialize_mergetag()
test_deserialize_mergetags()
test_encoding()
test_full_tree()
test_neg_timezone()
test_raw_length()
test_serialize_gpgsig()
test_serialize_mergetag()
test_serialize_mergetags()
test_short_timestamp()
test_simple()
test_timezone()
class dulwich.tests.test_objects.PrettyFormatTreeEntryTests(methodName='runTest')

Bases: 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_format()
class dulwich.tests.test_objects.ShaFileCheckTests(methodName='runTest')

Bases: 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.

assertCheckFails(cls, data)
assertCheckSucceeds(cls, data)
class dulwich.tests.test_objects.ShaFileCopyTests(methodName='runTest')

Bases: 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.

assert_copy(orig)
test_blob_copy()
test_commit_copy()
test_tag_copy()
test_tree_copy()
class dulwich.tests.test_objects.ShaFileSerializeTests(methodName='runTest')

Bases: TestCase

ShaFile objects only gets serialized once if they haven’t changed.

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.

assert_serialization_on_change(obj, needs_serialization_after_change=True)
test_blob_serialize()
test_commit_serialize()
test_tag_serialize()
test_tag_serialize_time_error()
test_tree_serialize()
class dulwich.tests.test_objects.ShaFileTests(methodName='runTest')

Bases: 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_deflated_smaller_window_buffer()
class dulwich.tests.test_objects.TagParseTests(methodName='runTest')

Bases: ShaFileCheckTests

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.

make_tag_lines(object_sha=b'a38d6181ff27824c79fc7df825164a212eff6a3f', object_type_name=b'commit', name=b'v2.6.22-rc7', tagger=b'Linus Torvalds <torvalds@woody.linux-foundation.org> 1183319674 -0700', message=b'Linux 2.6.22-rc7\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.7 (GNU/Linux)\n\niD8DBQBGiAaAF3YsRnbiHLsRAitMAKCiLboJkQECM/jpYsY3WPfvUgLXkACgg3ql\nOK2XeQOiEeXtT76rV4t2WR4=\n=ivrA\n-----END PGP SIGNATURE-----\n')
make_tag_text(**kwargs)
test_check()
test_check_duplicates()
test_check_order()
test_check_tag_with_overflow_time()

Date with overflow should raise an ObjectFormatException when checked

test_check_tag_with_unparseable_field()
test_parse()
test_parse_no_message()
test_parse_no_tagger()
test_tree_copy_after_update()

Check Tree.id is correctly updated when the tree is copied after updated.

class dulwich.tests.test_objects.TagSerializeTests(methodName='runTest')

Bases: 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_serialize_none_message()
test_serialize_simple()
class dulwich.tests.test_objects.TestHexToSha(methodName='runTest')

Bases: 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_reverse()
test_simple()
class dulwich.tests.test_objects.TimezoneTests(methodName='runTest')

Bases: 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_format_timezone_cet()
test_format_timezone_double_negative()
test_format_timezone_pdt()
test_format_timezone_pdt_half()
test_generate_timezone_utc()
test_generate_timezone_utc_negative()
test_parse_timezone_cet()
test_parse_timezone_double_negative()
test_parse_timezone_pdt()
test_parse_timezone_pdt_half()
test_parse_timezone_utc()
test_parse_timezone_utc_negative()
class dulwich.tests.test_objects.TreeTests(methodName='runTest')

Bases: ShaFileCheckTests

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_add()
test_check()
test_iter()
test_parse_tree()
test_parse_tree_extension()
test_simple()
test_sorted_tree_items()
test_sorted_tree_items_extension()
test_sorted_tree_items_name_order()
test_sorted_tree_items_name_order_extension()
test_tree_items_dir_sort()
test_tree_iteritems_dir_sort()
test_tree_update_id()