Rev 4790: Updates to tests that were exercising filesystem globbing. in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b3-glob-updates
John Arbash Meinel
john at arbash-meinel.com
Sun Nov 8 00:05:34 GMT 2009
At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b3-glob-updates
------------------------------------------------------------
revno: 4790
revision-id: john at arbash-meinel.com-20091108000526-33vvx9svs5acs38x
parent: pqm at pqm.ubuntu.com-20091106084512-t5ll6xywcd1bycfe
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b3-glob-updates
timestamp: Sat 2009-11-07 18:05:26 -0600
message:
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.
-------------- next part --------------
=== modified file 'bzrlib/tests/blackbox/test_add.py'
--- a/bzrlib/tests/blackbox/test_add.py 2009-08-10 08:25:05 +0000
+++ b/bzrlib/tests/blackbox/test_add.py 2009-11-08 00:05:26 +0000
@@ -27,7 +27,6 @@
SymlinkFeature
)
from bzrlib.tests.blackbox import ExternalBase
-from bzrlib.tests.test_win32utils import NeedsGlobExpansionFeature
def load_tests(standard_tests, module, loader):
@@ -211,20 +210,6 @@
err = self.run_bzr('add .bzr/crescent', retcode=3)[1]
self.assertContainsRe(err, r'ERROR:.*\.bzr.*control file')
- def test_add_with_wildcards(self):
- self.requireFeature(NeedsGlobExpansionFeature)
- self.make_branch_and_tree('.')
- self.build_tree(['a1', 'a2', 'b', 'c33'])
- self.run_bzr(['add', 'a?', 'c*'])
- self.assertEquals(self.run_bzr('unknowns')[0], 'b\n')
-
- def test_add_with_wildcards_unicode(self):
- self.requireFeature(NeedsGlobExpansionFeature)
- self.make_branch_and_tree('.')
- self.build_tree([u'\u1234A', u'\u1235A', u'\u1235AA', 'cc'])
- self.run_bzr(['add', u'\u1234?', u'\u1235*'])
- self.assertEquals(self.run_bzr('unknowns')[0], 'cc\n')
-
def test_add_via_symlink(self):
self.requireFeature(SymlinkFeature)
self.make_branch_and_tree('source')
=== modified file 'bzrlib/tests/test_win32utils.py'
--- a/bzrlib/tests/test_win32utils.py 2009-11-04 22:12:46 +0000
+++ b/bzrlib/tests/test_win32utils.py 2009-11-08 00:05:26 +0000
@@ -32,19 +32,6 @@
from bzrlib.win32utils import glob_expand, get_app_path
-# Features
-# --------
-
-class _NeedsGlobExpansionFeature(Feature):
-
- def _probe(self):
- return sys.platform == 'win32'
-
- def feature_name(self):
- return 'Internally performed glob expansion'
-
-NeedsGlobExpansionFeature = _NeedsGlobExpansionFeature()
-
class _RequiredModuleFeature(Feature):
@@ -70,19 +57,9 @@
# Tests
# -----
-class TestNeedsGlobExpansionFeature(TestCase):
-
- def test_available(self):
- self.assertEqual(sys.platform == 'win32',
- NeedsGlobExpansionFeature.available())
-
- def test_str(self):
- self.assertTrue("performed" in str(NeedsGlobExpansionFeature))
-
-
class TestWin32UtilsGlobExpand(TestCaseInTempDir):
- _test_needs_features = [NeedsGlobExpansionFeature]
+ _test_needs_features = []
def test_empty_tree(self):
self.build_tree([])
@@ -126,7 +103,9 @@
def test_tree_unicode(self):
"""Checks behaviour with non-ascii filenames"""
- self.build_tree([u'\u1234', u'\u1234\u1234', u'\u1235/', u'\u1235/\u1235'])
+ self.requireFeature(UnicodeFilenameFeature)
+ self.build_tree([u'\u1234', u'\u1234\u1234', u'\u1235/',
+ u'\u1235/\u1235'])
self._run_testset([
# no wildcards
[[u'\u1234'], [u'\u1234']],
More information about the bazaar-commits
mailing list