/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Martin Pool
  • Date: 2011-04-14 07:53:38 UTC
  • mto: This revision was merged to the branch mainline in revision 5788.
  • Revision ID: mbp@sourcefrog.net-20110414075338-0cwknb7zokfouzwj
Stop using failIf, failUnless, etc

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
class TestContainsWhitespace(tests.TestCase):
104
104
 
105
105
    def test_contains_whitespace(self):
106
 
        self.failUnless(osutils.contains_whitespace(u' '))
107
 
        self.failUnless(osutils.contains_whitespace(u'hello there'))
108
 
        self.failUnless(osutils.contains_whitespace(u'hellothere\n'))
109
 
        self.failUnless(osutils.contains_whitespace(u'hello\nthere'))
110
 
        self.failUnless(osutils.contains_whitespace(u'hello\rthere'))
111
 
        self.failUnless(osutils.contains_whitespace(u'hello\tthere'))
 
106
        self.assertTrue(osutils.contains_whitespace(u' '))
 
107
        self.assertTrue(osutils.contains_whitespace(u'hello there'))
 
108
        self.assertTrue(osutils.contains_whitespace(u'hellothere\n'))
 
109
        self.assertTrue(osutils.contains_whitespace(u'hello\nthere'))
 
110
        self.assertTrue(osutils.contains_whitespace(u'hello\rthere'))
 
111
        self.assertTrue(osutils.contains_whitespace(u'hello\tthere'))
112
112
 
113
113
        # \xa0 is "Non-breaking-space" which on some python locales thinks it
114
114
        # is whitespace, but we do not.
115
 
        self.failIf(osutils.contains_whitespace(u''))
116
 
        self.failIf(osutils.contains_whitespace(u'hellothere'))
117
 
        self.failIf(osutils.contains_whitespace(u'hello\xa0there'))
 
115
        self.assertFalse(osutils.contains_whitespace(u''))
 
116
        self.assertFalse(osutils.contains_whitespace(u'hellothere'))
 
117
        self.assertFalse(osutils.contains_whitespace(u'hello\xa0there'))
118
118
 
119
119
 
120
120
class TestRename(tests.TestCaseInTempDir):
488
488
        f = file('MixedCaseName', 'w')
489
489
        f.close()
490
490
        actual = osutils.canonical_relpath(self.test_base_dir, 'mixedcasename')
491
 
        self.failUnlessEqual('work/MixedCaseName', actual)
 
491
        self.assertEqual('work/MixedCaseName', actual)
492
492
 
493
493
    def test_canonical_relpath_missing_tail(self):
494
494
        os.mkdir('MixedCaseParent')
495
495
        actual = osutils.canonical_relpath(self.test_base_dir,
496
496
                                           'mixedcaseparent/nochild')
497
 
        self.failUnlessEqual('work/MixedCaseParent/nochild', actual)
 
497
        self.assertEqual('work/MixedCaseParent/nochild', actual)
498
498
 
499
499
 
500
500
class Test_CICPCanonicalRelpath(tests.TestCaseWithTransport):
1666
1666
        old = osutils.set_or_unset_env('BZR_TEST_ENV_VAR', None)
1667
1667
        self.assertEqual('foo', old)
1668
1668
        self.assertEqual(None, os.environ.get('BZR_TEST_ENV_VAR'))
1669
 
        self.failIf('BZR_TEST_ENV_VAR' in os.environ)
 
1669
        self.assertFalse('BZR_TEST_ENV_VAR' in os.environ)
1670
1670
 
1671
1671
 
1672
1672
class TestSizeShaFile(tests.TestCaseInTempDir):