~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: Danny van Heumen
  • Date: 2010-03-09 21:42:11 UTC
  • mto: (4634.139.5 2.0)
  • mto: This revision was merged to the branch mainline in revision 5160.
  • Revision ID: danny@dannyvanheumen.nl-20100309214211-iqh42x6qcikgd9p3
Reverted now-useless TODO list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
669
669
        # no kibble
670
670
        check_dir(['held'])
671
671
 
 
672
    def test_no_lockdir_info(self):
 
673
        """We can cope with empty info files."""
 
674
        # This seems like a fairly common failure case - see
 
675
        # <https://bugs.edge.launchpad.net/bzr/+bug/185103> and all its dupes.
 
676
        # Processes are often interrupted after opening the file
 
677
        # before the actual contents are committed.
 
678
        t = self.get_transport()
 
679
        t.mkdir('test_lock')
 
680
        t.mkdir('test_lock/held')
 
681
        t.put_bytes('test_lock/held/info', '')
 
682
        lf = LockDir(t, 'test_lock')
 
683
        info = lf.peek()
 
684
        formatted_info = lf._format_lock_info(info)
 
685
        self.assertEquals(
 
686
            ['lock %s' % t.abspath('test_lock'),
 
687
             'held by <unknown> on host <unknown> [process #<unknown>]',
 
688
             'locked (unknown)'],
 
689
            formatted_info)
 
690
 
672
691
 
673
692
class TestLockDirHooks(TestCaseWithTransport):
674
693