Rev 3789: Ensure SHA1KnitCorrupt formats ok. in http://people.ubuntu.com/~robertc/baz2.0/knits

Robert Collins robertc at robertcollins.net
Tue Oct 21 04:47:17 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/knits

------------------------------------------------------------
revno: 3789
revision-id: robertc at robertcollins.net-20081021034713-dhjfb9ypmnyr6nga
parent: robertc at robertcollins.net-20081021033614-e29ktibkuh7e5zps
committer: Robert Collins <robertc at robertcollins.net>
branch nick: knits
timestamp: Tue 2008-10-21 14:47:13 +1100
message:
  Ensure SHA1KnitCorrupt formats ok.
modified:
  bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
  bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py	2008-10-21 03:36:14 +0000
+++ b/bzrlib/errors.py	2008-10-21 03:47:13 +0000
@@ -1426,9 +1426,9 @@
 
 class SHA1KnitCorrupt(KnitCorrupt):
 
-    _fmy = ("Knit %(filename)s corrupt: sha-1 of reconstructed text does not "
+    _fmt = ("Knit %(filename)s corrupt: sha-1 of reconstructed text does not "
         "match expected sha-1. key %(key)s expected sha %(expected)s actual "
-        "sha %(actual)")
+        "sha %(actual)s")
 
     def __init__(self, filename, actual, expected, key, content):
         KnitError.__init__(self)

=== modified file 'bzrlib/tests/test_knit.py'
--- a/bzrlib/tests/test_knit.py	2008-10-21 03:36:14 +0000
+++ b/bzrlib/tests/test_knit.py	2008-10-21 03:47:13 +0000
@@ -943,6 +943,8 @@
         err = self.assertRaises(errors.KnitCorrupt,
             target.get_record_stream([broken], 'unordered', True).next)
         self.assertEqual(['gam\n', 'bar\n'], err.content)
+        # Test for formatting with live data
+        self.assertStartsWith(str(err), "Knit ")
 
 
 class TestKnitIndex(KnitTests):




More information about the bazaar-commits mailing list