~ubuntu-branches/ubuntu/maverick/bzr/maverick

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-03-24 22:27:38 UTC
  • mfrom: (1.4.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100324222738-5lsc0gdzmtcdp1vp
Tags: 2.1.1-1
* Remove bob2 from uploaders. Closes: #573427
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2008, 2010 Canonical Ltd
 
1
# Copyright (C) 2006-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
666
666
        # no kibble
667
667
        check_dir(['held'])
668
668
 
 
669
    def test_no_lockdir_info(self):
 
670
        """We can cope with empty info files."""
 
671
        # This seems like a fairly common failure case - see
 
672
        # <https://bugs.edge.launchpad.net/bzr/+bug/185103> and all its dupes.
 
673
        # Processes are often interrupted after opening the file
 
674
        # before the actual contents are committed.
 
675
        t = self.get_transport()
 
676
        t.mkdir('test_lock')
 
677
        t.mkdir('test_lock/held')
 
678
        t.put_bytes('test_lock/held/info', '')
 
679
        lf = LockDir(t, 'test_lock')
 
680
        info = lf.peek()
 
681
        formatted_info = lf._format_lock_info(info)
 
682
        self.assertEquals(
 
683
            ['lock %s' % t.abspath('test_lock'),
 
684
             'held by <unknown> on host <unknown> [process #<unknown>]',
 
685
             'locked (unknown)'],
 
686
            formatted_info)
 
687
 
669
688
 
670
689
class TestLockDirHooks(TestCaseWithTransport):
671
690