/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/per_workingtree/test_workingtree.py

Update the GitTreeTransform to not use file ids internally.

Merged from https://code.launchpad.net/~jelmer/brz/transform/+merge/389623

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
    def test_lock_locks_branch(self):
217
217
        tree = self.make_branch_and_tree('.')
218
218
        self.assertEqual(None, tree.branch.peek_lock_mode())
219
 
        tree.lock_read()
220
 
        self.assertEqual('r', tree.branch.peek_lock_mode())
221
 
        tree.unlock()
 
219
        with tree.lock_read():
 
220
            self.assertEqual('r', tree.branch.peek_lock_mode())
222
221
        self.assertEqual(None, tree.branch.peek_lock_mode())
223
 
        tree.lock_write()
224
 
        self.assertEqual('w', tree.branch.peek_lock_mode())
225
 
        tree.unlock()
 
222
        with tree.lock_write():
 
223
            self.assertEqual('w', tree.branch.peek_lock_mode())
226
224
        self.assertEqual(None, tree.branch.peek_lock_mode())
227
225
 
228
226
    def test_revert(self):
1013
1011
        if tree.branch.repository._format.supports_versioned_directories:
1014
1012
            self.assertEqual('directory', tree.stored_kind('b'))
1015
1013
 
 
1014
    def test_stored_kind_nonexistent(self):
 
1015
        tree = self.make_branch_and_tree('tree')
 
1016
        tree.lock_write()
 
1017
        self.assertRaises(errors.NoSuchFile, tree.stored_kind, 'a')
 
1018
        self.addCleanup(tree.unlock)
 
1019
        self.build_tree(['tree/a'])
 
1020
        self.assertRaises(errors.NoSuchFile, tree.stored_kind, 'a')
 
1021
        tree.add(['a'])
 
1022
        self.assertIs('file', tree.stored_kind('a'))
 
1023
 
1016
1024
    def test_missing_file_sha1(self):
1017
1025
        """If a file is missing, its sha1 should be reported as None."""
1018
1026
        tree = self.make_branch_and_tree('.')