~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_content_filters.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2010, 2012, 2016 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
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib.bzrdir import BzrDir
 
21
from bzrlib.controldir import ControlDir
22
22
from bzrlib.filters import ContentFilter
23
23
from bzrlib.switch import switch
24
24
from bzrlib.workingtree import WorkingTree
237
237
        self.addCleanup(source.unlock)
238
238
 
239
239
        expected_canonical_form = 'Foo Txt\nend string\n'
240
 
        self.assertEquals(source.get_file(txt_fileid, filtered=True).read(),
 
240
        self.assertEqual(source.get_file(txt_fileid, filtered=True).read(),
241
241
            expected_canonical_form)
242
 
        self.assertEquals(source.get_file(txt_fileid, filtered=False).read(),
 
242
        self.assertEqual(source.get_file(txt_fileid, filtered=False).read(),
243
243
            'Foo Txt')
244
244
 
245
245
        # results are: kind, size, executable, sha1_or_link_target
246
246
        result = source.path_content_summary('file1.txt')
247
247
 
248
 
        self.assertEquals(result,
 
248
        self.assertEqual(result,
249
249
            ('file', None, False, None))
250
250
 
251
251
        # we could give back the length of the canonical form, but in general
330
330
        self.assertFileEqual("fOO tXT", 'checkout/file1.txt')
331
331
 
332
332
        # Switch it to branch-b and check the tree is updated
333
 
        checkout_control_dir = BzrDir.open_containing('checkout')[0]
 
333
        checkout_control_dir = ControlDir.open_containing('checkout')[0]
334
334
        switch(checkout_control_dir, source.branch)
335
335
        self.assertFileEqual("fOO rocks!", 'checkout/file1.txt')
336
336
        self.assertFileEqual("hELLO wORLD", 'checkout/file4.txt')