~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_win32utils.py

Updates to tests that were exercising filesystem globbing.

The win32utils glob tests can be run on all platforms, they don't
actually require win32 at all.
The tests in 'blackbox.test_add' no longer apply, because we glob at
the command-line parser, not in cmd_add, so they should be tested at
the command-line parser level.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from bzrlib.win32utils import glob_expand, get_app_path
33
33
 
34
34
 
35
 
# Features
36
 
# --------
37
 
 
38
 
class _NeedsGlobExpansionFeature(Feature):
39
 
 
40
 
    def _probe(self):
41
 
        return sys.platform == 'win32'
42
 
 
43
 
    def feature_name(self):
44
 
        return 'Internally performed glob expansion'
45
 
 
46
 
NeedsGlobExpansionFeature = _NeedsGlobExpansionFeature()
47
 
 
48
35
 
49
36
class _RequiredModuleFeature(Feature):
50
37
 
70
57
# Tests
71
58
# -----
72
59
 
73
 
class TestNeedsGlobExpansionFeature(TestCase):
74
 
 
75
 
    def test_available(self):
76
 
        self.assertEqual(sys.platform == 'win32',
77
 
                         NeedsGlobExpansionFeature.available())
78
 
 
79
 
    def test_str(self):
80
 
        self.assertTrue("performed" in str(NeedsGlobExpansionFeature))
81
 
 
82
 
 
83
60
class TestWin32UtilsGlobExpand(TestCaseInTempDir):
84
61
 
85
 
    _test_needs_features = [NeedsGlobExpansionFeature]
 
62
    _test_needs_features = []
86
63
 
87
64
    def test_empty_tree(self):
88
65
        self.build_tree([])
126
103
 
127
104
    def test_tree_unicode(self):
128
105
        """Checks behaviour with non-ascii filenames"""
129
 
        self.build_tree([u'\u1234', u'\u1234\u1234', u'\u1235/', u'\u1235/\u1235'])
 
106
        self.requireFeature(UnicodeFilenameFeature)
 
107
        self.build_tree([u'\u1234', u'\u1234\u1234', u'\u1235/',
 
108
                         u'\u1235/\u1235'])
130
109
        self._run_testset([
131
110
            # no wildcards
132
111
            [[u'\u1234'], [u'\u1234']],