From 33ebe7acec14b25c5f84f35a664803fcab2f7781 Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Wed, 7 May 2008 16:49:48 -0400 Subject: initial project --- test/git/test_head.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/git/test_head.py (limited to 'test/git/test_head.py') diff --git a/test/git/test_head.py b/test/git/test_head.py new file mode 100644 index 00000000..38b2a5ab --- /dev/null +++ b/test/git/test_head.py @@ -0,0 +1,19 @@ +from mock import * +from gitalicious.test.asserts import * +from gitalicious.lib import * +from gitalicious.test.helper import * + +class TestHead(object): + def setup(self): + self.repo = Repo(GIT_REPO) + + @patch(Git, 'method_missing') + def test_repr(self, git): + git.return_value = fixture('for_each_ref') + + head = self.repo.heads[0] + + assert_equal('' % head.name, repr(head)) + + assert_true(git.called) + assert_equal(git.call_args, (('for_each_ref', 'refs/heads'), {'sort': 'committerdate', 'format': '%(refname)%00%(objectname)'})) -- cgit v1.2.1