~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Ian Clatworthy
  • Date: 2009-03-18 02:03:22 UTC
  • mto: (4159.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 4161.
  • Revision ID: ian.clatworthy@canonical.com-20090318020322-75tdtdapmjbadbup
feedback from poolie - use SHA, not Sha, in class names

Show diffs side-by-side

added added

removed removed

Lines of Context:
2230
2230
                                      'link-revision-id'), inv_entry)
2231
2231
 
2232
2232
 
2233
 
class TestSha1Provider(TestCaseInTempDir):
 
2233
class TestSHA1Provider(TestCaseInTempDir):
2234
2234
 
2235
2235
    def test_sha1provider_is_an_interface(self):
2236
 
        p = dirstate.Sha1Provider()
 
2236
        p = dirstate.SHA1Provider()
2237
2237
        self.assertRaises(NotImplementedError, p.sha1, "foo")
2238
2238
        self.assertRaises(NotImplementedError, p.stat_and_sha1, "foo")
2239
2239
 
2241
2241
        text = 'test\r\nwith\nall\rpossible line endings\r\n'
2242
2242
        self.build_tree_contents([('foo', text)])
2243
2243
        expected_sha = osutils.sha_string(text)
2244
 
        p = dirstate.DefaultSha1Provider()
 
2244
        p = dirstate.DefaultSHA1Provider()
2245
2245
        self.assertEqual(expected_sha, p.sha1('foo'))
2246
2246
 
2247
2247
    def test_defaultsha1provider_stat_and_sha1(self):
2248
2248
        text = 'test\r\nwith\nall\rpossible line endings\r\n'
2249
2249
        self.build_tree_contents([('foo', text)])
2250
2250
        expected_sha = osutils.sha_string(text)
2251
 
        p = dirstate.DefaultSha1Provider()
 
2251
        p = dirstate.DefaultSHA1Provider()
2252
2252
        statvalue, sha1 = p.stat_and_sha1('foo')
2253
2253
        self.assertTrue(len(statvalue) >= 10)
2254
2254
        self.assertEqual(len(text), statvalue.st_size)