/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: Vincent Ladeuil
  • Date: 2011-05-12 20:26:05 UTC
  • mto: (5853.1.2 trunk) (5609.38.1 2.3)
  • mto: This revision was merged to the branch mainline in revision 5861.
  • Revision ID: v.ladeuil+lp@free.fr-20110512202605-whwfrkgddrxv1exm
Backport fix for deprecated test methods (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):
469
469
        f = file('MixedCaseName', 'w')
470
470
        f.close()
471
471
        actual = osutils.canonical_relpath(self.test_base_dir, 'mixedcasename')
472
 
        self.failUnlessEqual('work/MixedCaseName', actual)
 
472
        self.assertEqual('work/MixedCaseName', actual)
473
473
 
474
474
    def test_canonical_relpath_missing_tail(self):
475
475
        os.mkdir('MixedCaseParent')
476
476
        actual = osutils.canonical_relpath(self.test_base_dir,
477
477
                                           'mixedcaseparent/nochild')
478
 
        self.failUnlessEqual('work/MixedCaseParent/nochild', actual)
 
478
        self.assertEqual('work/MixedCaseParent/nochild', actual)
479
479
 
480
480
 
481
481
class Test_CICPCanonicalRelpath(tests.TestCaseWithTransport):
1647
1647
        old = osutils.set_or_unset_env('BZR_TEST_ENV_VAR', None)
1648
1648
        self.assertEqual('foo', old)
1649
1649
        self.assertEqual(None, os.environ.get('BZR_TEST_ENV_VAR'))
1650
 
        self.failIf('BZR_TEST_ENV_VAR' in os.environ)
 
1650
        self.assertFalse('BZR_TEST_ENV_VAR' in os.environ)
1651
1651
 
1652
1652
 
1653
1653
class TestSizeShaFile(tests.TestCaseInTempDir):