~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to test_grep.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-20 15:39:20 UTC
  • mto: (6531.3.1 merge-grep)
  • mto: This revision was merged to the branch mainline in revision 6555.
  • Revision ID: jelmer@canonical.com-20111220153920-ua3amlyncnmu69tx
Fix compatibility with newer versions of bzr: don't use relative imports in lazy imports, and import features from bzrlib.tests.features.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
import os
18
20
import re
19
21
import unicodedata as ud
20
22
 
21
 
import features
22
 
from termcolor import color_string, FG
 
23
from bzrlib.plugins.grep import features
 
24
from bzrlib.plugins.grep.termcolor import color_string, FG
23
25
 
24
26
from bzrlib import tests, osutils
25
27
 
 
28
try:
 
29
    from bzrlib.tests.features import UnicodeFilenameFeature
 
30
except ImportError: # bzr < 2.4
 
31
    from bzrlib.tests import UnicodeFilenameFeature
 
32
 
26
33
# NOTE: As bzr-grep optimizes PATTERN search to -F/--fixed-string
27
34
# for patterns that are not alphanumeric+whitespace, we test grep
28
35
# specfically with patterns that have special characters so that
1945
1952
class TestNonAscii(GrepTestBase):
1946
1953
    """Tests for non-ascii filenames and file contents"""
1947
1954
 
1948
 
    _test_needs_features = [tests.UnicodeFilenameFeature]
 
1955
    _test_needs_features = [UnicodeFilenameFeature]
1949
1956
 
1950
1957
    def test_unicode_only_file(self):
1951
1958
        """Test filename and contents that requires a unicode encoding"""