~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2016-01-15 09:21:49 UTC
  • mfrom: (6606.2.1 autodoc-unicode)
  • Revision ID: pqm@pqm.ubuntu.com-20160115092149-z5f4sfq3jvaz0enb
(vila) Fix autodoc runner when LANG=C. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import time
20
20
 
 
21
from bzrlib import errors
 
22
 
21
23
from bzrlib.tests.per_tree import TestCaseWithTree
22
24
 
23
25
 
38
40
        # file, working trees return the on-disk time.
39
41
        mtime_file_id = tree.get_file_mtime(file_id='one-id')
40
42
        self.assertIsInstance(mtime_file_id, (float, int))
41
 
        self.failUnless(now - 5 < mtime_file_id < now + 5,
 
43
        self.assertTrue(now - 5 < mtime_file_id < now + 5,
42
44
                        'now: %f, mtime_file_id: %f' % (now, mtime_file_id ))
43
45
        mtime_path = tree.get_file_mtime(file_id='one-id', path='one')
44
46
        self.assertEqual(mtime_file_id, mtime_path)
 
47
 
 
48
    def test_nonexistant(self):
 
49
        tree = self.get_basic_tree()
 
50
        tree.lock_read()
 
51
        self.addCleanup(tree.unlock)
 
52
        self.assertRaises(errors.NoSuchId,
 
53
            tree.get_file_mtime, file_id='unexistant')