~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Marius Kruger
  • Date: 2010-07-10 20:46:48 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710204648-5pw4ogv9tmsslea3
* gen_backup_name => generate_backup_name
* write some tests for generate_backup_name

Show diffs side-by-side

added added

removed removed

Lines of Context:
1401
1401
        self.assertIsInstance(params, RepoInitHookParams)
1402
1402
        self.assertTrue(hasattr(params, 'bzrdir'))
1403
1403
        self.assertTrue(hasattr(params, 'repository'))
 
1404
 
 
1405
 
 
1406
class TestGenerateBackupName(TestCaseWithMemoryTransport):
 
1407
 
 
1408
    def setUp(self):
 
1409
        super(TestGenerateBackupName, self).setUp()
 
1410
        self._transport = get_transport(self.get_url())
 
1411
        bzrdir.BzrDir.create(self.get_url(),
 
1412
            possible_transports=[self._transport])
 
1413
        self._bzrdir = bzrdir.BzrDir.open_from_transport(self._transport)
 
1414
 
 
1415
    def test_new(self):
 
1416
        self.assertEqual("a.~1~", self._bzrdir.generate_backup_name("a"))
 
1417
 
 
1418
    def test_exiting(self):
 
1419
        self._transport.put_bytes("a.~1~", "some content")
 
1420
        self.assertEqual("a.~2~", self._bzrdir.generate_backup_name("a"))