diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-04-07 20:17:00 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-04-07 20:17:00 +0200 |
commit | a12a7618a1f6f61a4c97ddf4cc422158c3fa72ba (patch) | |
tree | 2b2e0e9991ddede152556f7954cd6e4c6121be97 /git/test/objects/test_blob.py | |
parent | e77d2d0ebb9487b696835f219e4a23a558462a55 (diff) | |
download | gitpython-a12a7618a1f6f61a4c97ddf4cc422158c3fa72ba.tar.gz |
Updated objects to use the ones defined in gitdb as basis. Only the submodule implementation is left in git-python as it requires some advanced features. No tests where run yet
Diffstat (limited to 'git/test/objects/test_blob.py')
-rw-r--r-- | git/test/objects/test_blob.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/git/test/objects/test_blob.py b/git/test/objects/test_blob.py new file mode 100644 index 00000000..661c0501 --- /dev/null +++ b/git/test/objects/test_blob.py @@ -0,0 +1,23 @@ +# test_blob.py +# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# +# This module is part of GitPython and is released under +# the BSD License: http://www.opensource.org/licenses/bsd-license.php + +from git.test.lib import * +from git import * +from gitdb.util import hex_to_bin + +class TestBlob(TestBase): + + def test_mime_type_should_return_mime_type_for_known_types(self): + blob = Blob(self.rorepo, **{'binsha': Blob.NULL_BIN_SHA, 'path': 'foo.png'}) + assert_equal("image/png", blob.mime_type) + + def test_mime_type_should_return_text_plain_for_unknown_types(self): + blob = Blob(self.rorepo, **{'binsha': Blob.NULL_BIN_SHA,'path': 'something'}) + assert_equal("text/plain", blob.mime_type) + + def test_nodict(self): + self.failUnlessRaises(AttributeError, setattr, self.rorepo.tree()['AUTHORS'], 'someattr', 2) + |