~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__walkdirs_win32.py

  • Committer: Benoît Pierre
  • Date: 2009-11-02 22:24:29 UTC
  • mto: (4634.96.1 integration-2.0)
  • mto: This revision was merged to the branch mainline in revision 4798.
  • Revision ID: benoit.pierre@gmail.com-20091102222429-xqdyo6n8odh3xbbd
Small fix for handling of short option names in shellcomplete_on_options.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
22
22
    osutils,
23
23
    tests,
24
24
    )
25
 
from bzrlib.tests import (
26
 
    features,
27
 
    )
28
 
 
29
 
 
30
 
win32_readdir_feature = features.ModuleAvailableFeature('bzrlib._walkdirs_win32')
 
25
 
 
26
 
 
27
class _Win32ReadDirFeature(tests.Feature):
 
28
 
 
29
    def _probe(self):
 
30
        try:
 
31
            import bzrlib._walkdirs_win32
 
32
        except ImportError:
 
33
            return False
 
34
        else:
 
35
            return True
 
36
 
 
37
    def feature_name(self):
 
38
        return 'bzrlib._Win32ReadDir'
 
39
 
 
40
Win32ReadDirFeature = _Win32ReadDirFeature()
31
41
 
32
42
 
33
43
class TestWin32Finder(tests.TestCaseInTempDir):
34
44
 
35
 
    _test_needs_features = [win32_readdir_feature]
 
45
    _test_needs_features = [Win32ReadDirFeature]
36
46
 
37
47
    def setUp(self):
38
48
        super(TestWin32Finder, self).setUp()
77
87
        self.assertReadDir([('foo', 'foo', 'file', u'./foo')],
78
88
            '', u'.')
79
89
 
80
 
    def test_directory(self):
 
90
    def test_dir(self):
81
91
        self.build_tree(['bar/'])
82
92
        self.assertReadDir([('bar', 'bar', 'directory', u'./bar')],
83
93
            '', u'.')