~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_diff.py

  • Committer: John Arbash Meinel
  • Date: 2006-12-01 19:41:16 UTC
  • mfrom: (2158 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2159.
  • Revision ID: john@arbash-meinel.com-20061201194116-nvn5qhfxux5284jc
[merge] bzr.dev 2158

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
 
113
113
    def test_external_diff_binary_lang_c(self):
114
114
        orig_lang = os.environ.get('LANG')
 
115
        orig_lc_all = os.environ.get('LC_ALL')
115
116
        try:
116
117
            os.environ['LANG'] = 'C'
 
118
            os.environ['LC_ALL'] = 'C'
117
119
            lines = external_udiff_lines(['\x00foobar\n'], ['foo\x00bar\n'])
118
120
            # Older versions of diffutils say "Binary files", newer
119
121
            # versions just say "Files".
121
123
                                  '(Binary f|F)iles old and new differ\n')
122
124
            self.assertEquals(lines[1:], ['\n'])
123
125
        finally:
124
 
            if orig_lang is None:
125
 
                del os.environ['LANG']
126
 
            else:
127
 
                os.environ['LANG'] = orig_lang
 
126
            for name, value in [('LANG', orig_lang), ('LC_ALL', orig_lc_all)]:
 
127
                if value is None:
 
128
                    del os.environ[name]
 
129
                else:
 
130
                    os.environ[name] = value
128
131
 
129
132
    def test_no_external_diff(self):
130
133
        """Check that NoDiff is raised when diff is not available"""