~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__dirstate_helpers.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:
1188
1188
    def test_sha1provider_sha1_used(self):
1189
1189
        tree, text = self._prepare_tree()
1190
1190
        state = dirstate.DirState.from_tree(tree, 'dirstate',
1191
 
            UppercaseSha1Provider())
 
1191
            UppercaseSHA1Provider())
1192
1192
        self.addCleanup(state.unlock)
1193
1193
        expected_sha = osutils.sha_string(text.upper() + "foo")
1194
1194
        entry = state._get_entry(0, path_utf8='a file')
1203
1203
        tree.lock_write()
1204
1204
        self.addCleanup(tree.unlock)
1205
1205
        state = tree._current_dirstate()
1206
 
        state._sha1_provider = UppercaseSha1Provider()
 
1206
        state._sha1_provider = UppercaseSHA1Provider()
1207
1207
        # If we used the standard provider, it would look like nothing has
1208
1208
        # changed
1209
1209
        file_ids_changed = [change[0] for change 
1211
1211
        self.assertEqual(['a-file-id'], file_ids_changed)
1212
1212
 
1213
1213
 
1214
 
class UppercaseSha1Provider():
1215
 
    """A custom Sha1Provider."""
 
1214
class UppercaseSHA1Provider():
 
1215
    """A custom SHA1Provider."""
1216
1216
 
1217
1217
    def sha1(self, abspath):
1218
1218
        return self.stat_and_sha1(abspath)[1]
1277
1277
        tree.lock_write()
1278
1278
        self.addCleanup(tree.unlock)
1279
1279
        state = tree._current_dirstate()
1280
 
        state._sha1_provider = UppercaseSha1Provider()
 
1280
        state._sha1_provider = UppercaseSHA1Provider()
1281
1281
        self.assertChangedFileIds(['file-id'], tree)
1282
1282
 
1283
1283