Add make_object and make_commit convenience functions to test utils.
authorDave Borowitz <dborowitz@google.com>
Mon, 22 Mar 2010 16:44:10 +0000 (09:44 -0700)
committerDave Borowitz <dborowitz@google.com>
Fri, 30 Apr 2010 16:41:54 +0000 (09:41 -0700)
commit5e441722773e7b6b836b1cd4fc4610335c34efb5
treeab49b84aa0fb647a7e12374f1d2973eac4ce9064
parent47e3826c03ee1a8ffc184af743ed14d9e39b82d8
Add make_object and make_commit convenience functions to test utils.

These functions reduce typing needed to create objects for testing.
Instead of
    test_object = Object()
    test_object.attr1 = foo
    test_object.attr2 = bar
we can now write
    test_object = make_object(Object, attr1=foo, attr2=bar)

This is even more simplified for Commit objects, which have many
attributes, most of which we usually don't care about. Using make_commit
pre-populates attributes with some arbitrary default values, ensuring
commit objects can be serialized.

Updated relevant test code to use the new methods.

Change-Id: Id8266774efb56ef92a3db6cca42d3ec9d81fd2a0
dulwich/tests/test_object_store.py
dulwich/tests/test_objects.py
dulwich/tests/test_pack.py
dulwich/tests/utils.py