~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: James Blackwell
  • Date: 2006-05-05 01:05:04 UTC
  • mfrom: (1697 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1700.
  • Revision ID: jblack@merconline.com-20060505010504-264cb48507e53b64
mergedĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
        self.assertRaises(AssertionError, self.assertIsDirectory, 'a_file', t)
376
376
        self.assertRaises(AssertionError, self.assertIsDirectory, 'not_here', t)
377
377
 
 
378
 
378
379
class TestChrootedTest(ChrootedTestCase):
379
380
 
380
381
    def test_root_is_root(self):
392
393
        self.assertIsInstance(u'', basestring)
393
394
        self.assertRaises(AssertionError, self.assertIsInstance, None, int)
394
395
        self.assertRaises(AssertionError, self.assertIsInstance, 23.3, int)
 
396
 
 
397
    def test_assertEndsWith(self):
 
398
        self.assertEndsWith('foo', 'oo')
 
399
        self.assertRaises(AssertionError, self.assertEndsWith, 'o', 'oo')
 
400
 
 
401
 
 
402
class TestConvenienceMakers(TestCaseWithTransport):
 
403
    """Test for the make_* convenience functions."""
 
404
 
 
405
    def test_make_branch_and_tree_with_format(self):
 
406
        # we should be able to supply a format to make_branch_and_tree
 
407
        self.make_branch_and_tree('a', format=bzrlib.bzrdir.BzrDirMetaFormat1())
 
408
        self.make_branch_and_tree('b', format=bzrlib.bzrdir.BzrDirFormat6())
 
409
        self.assertIsInstance(bzrlib.bzrdir.BzrDir.open('a')._format,
 
410
                              bzrlib.bzrdir.BzrDirMetaFormat1)
 
411
        self.assertIsInstance(bzrlib.bzrdir.BzrDir.open('b')._format,
 
412
                              bzrlib.bzrdir.BzrDirFormat6)