~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_status.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005-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
188
188
        wt2.merge_from_branch(wt.branch)
189
189
        message = self.status_string(wt2, verbose=True)
190
190
        self.assertStartsWith(message, "pending merges:\n")
191
 
        self.assert_("Empty commit 3" in message)
 
191
        self.assertTrue("Empty commit 3" in message)
192
192
        self.assertEndsWith(message, "...\n")
193
193
 
194
194
    def test_tree_status_ignores(self):
248
248
        tof = StringIO()
249
249
        show_tree_status(wt, specific_files=['directory'], to_file=tof)
250
250
        tof.seek(0)
251
 
        self.assertEquals(tof.readlines(),
 
251
        self.assertEqual(tof.readlines(),
252
252
                          ['unknown:\n',
253
253
                           '  directory/hello.c\n'
254
254
                           ])
256
256
        show_tree_status(wt, specific_files=['directory'], to_file=tof,
257
257
                         short=True)
258
258
        tof.seek(0)
259
 
        self.assertEquals(tof.readlines(), ['?   directory/hello.c\n'])
 
259
        self.assertEqual(tof.readlines(), ['?   directory/hello.c\n'])
260
260
 
261
261
        tof = StringIO()
262
262
        show_tree_status(wt, specific_files=['dir2'], to_file=tof)
263
263
        tof.seek(0)
264
 
        self.assertEquals(tof.readlines(),
 
264
        self.assertEqual(tof.readlines(),
265
265
                          ['unknown:\n',
266
266
                           '  dir2/\n'
267
267
                           ])
268
268
        tof = StringIO()
269
269
        show_tree_status(wt, specific_files=['dir2'], to_file=tof, short=True)
270
270
        tof.seek(0)
271
 
        self.assertEquals(tof.readlines(), ['?   dir2/\n'])
 
271
        self.assertEqual(tof.readlines(), ['?   dir2/\n'])
272
272
 
273
273
        tof = StringIO()
274
274
        revs = [RevisionSpec.from_string('0'), RevisionSpec.from_string('1')]
275
275
        show_tree_status(wt, specific_files=['test.c'], to_file=tof,
276
276
                         short=True, revision=revs)
277
277
        tof.seek(0)
278
 
        self.assertEquals(tof.readlines(), ['+N  test.c\n'])
 
278
        self.assertEqual(tof.readlines(), ['+N  test.c\n'])
279
279
 
280
280
        tof = StringIO()
281
281
        show_tree_status(wt, specific_files=['missing.c'], to_file=tof)
282
282
        tof.seek(0)
283
 
        self.assertEquals(tof.readlines(),
 
283
        self.assertEqual(tof.readlines(),
284
284
                          ['missing:\n',
285
285
                           '  missing.c\n'])
286
286
 
288
288
        show_tree_status(wt, specific_files=['missing.c'], to_file=tof,
289
289
                         short=True)
290
290
        tof.seek(0)
291
 
        self.assertEquals(tof.readlines(),
 
291
        self.assertEqual(tof.readlines(),
292
292
                          ['+!  missing.c\n'])
293
293
 
294
294
    def test_specific_files_conflicts(self):
627
627
        self.assertContainsRe(result, "added:\n  hello.txt\n" \
628
628
                                      "unknown:\n  world.txt\n")
629
629
        result2 = self.run_bzr("status -r 0..")[0]
630
 
        self.assertEquals(result2, result)
 
630
        self.assertEqual(result2, result)
631
631
 
632
632
    def test_status_short(self):
633
633
        tree = self.make_branch_and_tree('.')
649
649
        self.assertContainsRe(result, "[+]N  hello.txt\n" \
650
650
                                      "[?]   world.txt\n")
651
651
        result2 = self.run_bzr("status -S -r 0..")[0]
652
 
        self.assertEquals(result2, result)
 
652
        self.assertEqual(result2, result)
653
653
 
654
654
    def test_status_versioned(self):
655
655
        tree = self.make_branch_and_tree('.')
671
671
        self.assertContainsRe(result, "added:\n  hello.txt\n")
672
672
        self.assertNotContainsRe(result, "unknown:\n  world.txt\n")
673
673
        result2 = self.run_bzr("status --versioned -r 0..")[0]
674
 
        self.assertEquals(result2, result)
 
674
        self.assertEqual(result2, result)
675
675
 
676
676
    def test_status_SV(self):
677
677
        tree = self.make_branch_and_tree('.')
693
693
        self.assertContainsRe(result, "[+]N  hello.txt\n")
694
694
 
695
695
        result2 = self.run_bzr("status -SV -r 0..")[0]
696
 
        self.assertEquals(result2, result)
 
696
        self.assertEqual(result2, result)
697
697
 
698
698
    def assertStatusContains(self, pattern, short=False):
699
699
        """Run status, and assert it contains the given pattern"""
749
749
 
750
750
        self.run_bzr('merge ../b', working_dir='a')
751
751
        out, err = self.run_bzr('status --no-pending', working_dir='a')
752
 
        self.assertEquals(out, "added:\n  b\n")
 
752
        self.assertEqual(out, "added:\n  b\n")
753
753
 
754
754
    def test_pending_specific_files(self):
755
755
        """With a specific file list, pending merges are not shown."""
787
787
        working_tree = self.make_uncommitted_tree()
788
788
        stdout, stderr = self.run_bzr("status")
789
789
 
790
 
        self.assertEquals(stdout, """\
 
790
        self.assertEqual(stdout, """\
791
791
added:
792
792
  hell?
793
793
""")
797
797
        working_tree = self.make_uncommitted_tree()
798
798
        stdout, stderr = self.run_bzr('status')
799
799
 
800
 
        self.assertEquals(stdout, u"""\
 
800
        self.assertEqual(stdout, u"""\
801
801
added:
802
802
  hell\u00d8
803
803
""".encode('latin-1'))