~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Martin Pool
  • Date: 2011-04-15 07:01:22 UTC
  • mto: This revision was merged to the branch mainline in revision 5789.
  • Revision ID: mbp@sourcefrog.net-20110415070122-7x24skeadcm7wvut
Switch away from using failUnlessExists and failIfExists

Show diffs side-by-side

added added

removed removed

Lines of Context:
322
322
 
323
323
    def test_layout(self):
324
324
        branch = self.make_branch('a', format=self.get_format_name())
325
 
        self.failUnlessExists('a/.bzr/branch/last-revision')
326
 
        self.failIfExists('a/.bzr/branch/revision-history')
327
 
        self.failIfExists('a/.bzr/branch/references')
 
325
        self.assertPathExists('a/.bzr/branch/last-revision')
 
326
        self.assertPathDoesNotExist('a/.bzr/branch/revision-history')
 
327
        self.assertPathDoesNotExist('a/.bzr/branch/references')
328
328
 
329
329
    def test_config(self):
330
330
        """Ensure that all configuration data is stored in the branch"""
331
331
        branch = self.make_branch('a', format=self.get_format_name())
332
332
        branch.set_parent('http://example.com')
333
 
        self.failIfExists('a/.bzr/branch/parent')
 
333
        self.assertPathDoesNotExist('a/.bzr/branch/parent')
334
334
        self.assertEqual('http://example.com', branch.get_parent())
335
335
        branch.set_push_location('sftp://example.com')
336
336
        config = branch.get_config()._get_branch_data_config()
337
337
        self.assertEqual('sftp://example.com',
338
338
                         config.get_user_option('push_location'))
339
339
        branch.set_bound_location('ftp://example.com')
340
 
        self.failIfExists('a/.bzr/branch/bound')
 
340
        self.assertPathDoesNotExist('a/.bzr/branch/bound')
341
341
        self.assertEqual('ftp://example.com', branch.get_bound_location())
342
342
 
343
343
    def test_set_revision_history(self):
371
371
        subtree.commit('a subtree file')
372
372
        subsubtree.commit('a subsubtree file')
373
373
        tree.branch.create_checkout('target', lightweight=lightweight)
374
 
        self.failUnlessExists('target')
375
 
        self.failUnlessExists('target/subtree')
376
 
        self.failUnlessExists('target/subtree/file')
377
 
        self.failUnlessExists('target/subtree/subsubtree/file')
 
374
        self.assertPathExists('target')
 
375
        self.assertPathExists('target/subtree')
 
376
        self.assertPathExists('target/subtree/file')
 
377
        self.assertPathExists('target/subtree/subsubtree/file')
378
378
        subbranch = _mod_branch.Branch.open('target/subtree/subsubtree')
379
379
        if lightweight:
380
380
            self.assertEndsWith(subbranch.base, 'source/subtree/subsubtree/')