Blob.text() -> Blob.data
authorJelmer Vernooij <jelmer@samba.org>
Wed, 24 Dec 2008 02:06:03 +0000 (02:06 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 24 Dec 2008 02:06:03 +0000 (02:06 +0000)
dulwich/objects.py
dulwich/tests/test_objects.py

index 79f8599818ff7c4895153433c2f8c3d444501cd3..e5642e9fce1e5972711fda96c271c525e6b0c375 100644 (file)
@@ -172,7 +172,8 @@ class Blob(ShaFile):
 
   _type = blob_id
 
-  def text(self):
+  @property
+  def data(self):
     """The text contained within the blob object."""
     return self._text
 
index 8630571f2404459b8cb7cb89441e1361c21de66d..726995fcf832b2d26ba6968553a782425098032c 100644 (file)
@@ -48,25 +48,25 @@ class BlobReadTests(unittest.TestCase):
 
   def test_decompress_simple_blob(self):
     b = self.get_blob(a_sha)
-    self.assertEqual(b.text(), 'test 1\n')
+    self.assertEqual(b.data, 'test 1\n')
     self.assertEqual(b.sha().hexdigest(), a_sha)
 
   def test_parse_empty_blob_object(self):
     sha = 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
     b = self.get_blob(sha)
-    self.assertEqual(b.text(), '')
+    self.assertEqual(b.data, '')
     self.assertEqual(b.sha().hexdigest(), sha)
 
   def test_create_blob_from_string(self):
     string = 'test 2\n'
     b = Blob.from_string(string)
-    self.assertEqual(b.text(), string)
+    self.assertEqual(b.data, string)
     self.assertEqual(b.sha().hexdigest(), b_sha)
 
   def test_parse_legacy_blob(self):
     string = 'test 3\n'
     b = self.get_blob(c_sha)
-    self.assertEqual(b.text(), string)
+    self.assertEqual(b.data, string)
     self.assertEqual(b.sha().hexdigest(), c_sha)
 
   def test_eq(self):