diff options
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/lib/helper.py | 2 | ||||
-rw-r--r-- | git/test/test_fun.py | 7 | ||||
-rw-r--r-- | git/test/test_git.py | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py index 2634ecdb..a76f1a15 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -227,7 +227,7 @@ class TestBase(TestCase): """ @classmethod - def setUp(cls): + def setUpClass(cls): """ Dynamically add a read-only repository to our actual type. This way each test type has its own repository diff --git a/git/test/test_fun.py b/git/test/test_fun.py index 530988ef..096cd368 100644 --- a/git/test/test_fun.py +++ b/git/test/test_fun.py @@ -2,7 +2,8 @@ from git.test.lib import * from git.objects.fun import ( traverse_tree_recursive, traverse_trees_recursive, - tree_to_stream + tree_to_stream, + tree_entries_from_data ) from git.index.fun import ( @@ -249,3 +250,7 @@ class TestFun(TestBase): entries = traverse_tree_recursive(odb, commit.tree.binsha, '') assert entries # END for each commit + + def test_tree_entries_from_data(self): + r = tree_entries_from_data(b'100644 \x9f\0aaa') + assert r == [('aaa', 33188, '\x9f')], r diff --git a/git/test/test_git.py b/git/test/test_git.py index cdea1d3e..7132aa83 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -18,8 +18,8 @@ from git import ( Git, class TestGit(TestBase): @classmethod - def setUp(cls): - super(TestGit, cls).setUp() + def setUpClass(cls): + super(TestGit, cls).setUpClass() cls.git = Git(cls.rorepo.working_dir) @patch.object(Git, 'execute') |