~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_get_file_mtime.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-21 12:51:13 UTC
  • mfrom: (6153.1.5 847435-diff-time)
  • Revision ID: pqm@pqm.ubuntu.com-20110921125113-1fs5cdcrixafkkfs
(jelmer) Raise NoSuchId from Tree.get_file_mtime if the file id was not
 found. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
 
21
from bzrlib import errors
21
22
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
22
23
 
23
24
 
98
99
            self.assertAlmostEqual(st.st_mtime, mtime)
99
100
        finally:
100
101
            tree.unlock()
 
102
 
 
103
    def test_missing(self):
 
104
        tree = self.make_basic_tree()
 
105
 
 
106
        os.remove('tree/one')
 
107
        tree.lock_read()
 
108
        try:
 
109
            self.assertRaises(errors.FileTimestampUnavailable,
 
110
                tree.get_file_mtime, file_id='one-id')
 
111
        finally:
 
112
            tree.unlock()
 
113