/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_selftest.py

merge integration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import sys
21
21
import unittest
22
22
 
23
 
from bzrlib.tests import TestCase, _load_module_by_name, \
24
 
        TestSkipped
25
 
import bzrlib.tests
 
23
from bzrlib.tests import (
 
24
                          _load_module_by_name,
 
25
                          TestCase,
 
26
                          TestCaseInTempDir,
 
27
                          TestSkipped,
 
28
                          TextTestRunner,
 
29
                          )
26
30
 
27
31
 
28
32
class SelftestTests(TestCase):
46
50
        self.assertContainsRe(self._get_log(), 'a test message\n')
47
51
 
48
52
 
 
53
class TestTreeShape(TestCaseInTempDir):
 
54
 
 
55
    def test_unicode_paths(self):
 
56
        filename = u'hell\u00d8'
 
57
        try:
 
58
            self.build_tree_contents([(filename, 'contents of hello')])
 
59
        except UnicodeEncodeError:
 
60
            raise TestSkipped("can't build unicode working tree in "
 
61
                "filesystem encoding %s" % sys.getfilesystemencoding())
 
62
        self.failUnlessExists(filename)
 
63
 
 
64
 
49
65
class TestSkippedTest(TestCase):
50
66
    """Try running a test which is skipped, make sure it's reported properly."""
51
67
 
53
69
        # must be hidden in here so it's not run as a real test
54
70
        def skipping_test():
55
71
            raise TestSkipped('test intentionally skipped')
56
 
        runner = bzrlib.tests.TextTestRunner(stream=self._log_file)
 
72
        runner = TextTestRunner(stream=self._log_file)
57
73
        test = unittest.FunctionTestCase(skipping_test)
58
74
        result = runner.run(test)
59
75
        self.assertTrue(result.wasSuccessful())