/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

  • Committer: Jelmer Vernooij
  • Date: 2020-08-22 22:46:24 UTC
  • mfrom: (7490.40.105 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200822224624-om4a4idsr7cn8jew
merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

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