~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Packman
  • Date: 2011-11-28 19:07:58 UTC
  • mfrom: (6318 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6319.
  • Revision ID: martin.packman@canonical.com-20111128190758-5gj44o5uzwz5sjfq
Merge bzr.dev to resolve conflicts with updated registry help strings

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Tests for the info command of bzr."""
19
19
 
 
20
import shutil
20
21
import sys
21
22
 
22
23
from bzrlib import (
46
47
        self.assertEqual(out, '')
47
48
        self.assertEqual(err, 'bzr: ERROR: Not a branch: "%s".\n' % location)
48
49
 
 
50
    def test_info_empty_controldir(self):
 
51
        self.make_bzrdir('ctrl')
 
52
        out, err = self.run_bzr('info ctrl')
 
53
        self.assertEquals(out,
 
54
            'Empty control directory (format: 2a or pack-0.92)\n'
 
55
            'Location:\n'
 
56
            '  control directory: ctrl\n')
 
57
        self.assertEquals(err, '')
 
58
 
 
59
    def test_info_dangling_branch_reference(self):
 
60
        br = self.make_branch('target')
 
61
        br.create_checkout('from', lightweight=True)
 
62
        shutil.rmtree('target')
 
63
        out, err = self.run_bzr('info from')
 
64
        self.assertEquals(out,
 
65
            'Dangling branch reference (format: 2a or pack-0.92)\n'
 
66
            'Location:\n'
 
67
            '   control directory: from\n'
 
68
            '  checkout of branch: target\n')
 
69
        self.assertEquals(err, '')
 
70
 
49
71
    def test_info_standalone(self):
50
72
        transport = self.get_transport()
51
73
 
1403
1425
         0 revisions
1404
1426
""", out)
1405
1427
        self.assertEqual("", err)
 
1428
 
 
1429
 
 
1430
class TestSmartServerInfo(tests.TestCaseWithTransport):
 
1431
 
 
1432
    def test_simple_branch_info(self):
 
1433
        self.setup_smart_server_with_call_log()
 
1434
        t = self.make_branch_and_tree('branch')
 
1435
        self.build_tree_contents([('branch/foo', 'thecontents')])
 
1436
        t.add("foo")
 
1437
        t.commit("message")
 
1438
        self.reset_smart_call_log()
 
1439
        out, err = self.run_bzr(['info', self.get_url('branch')])
 
1440
        # This figure represent the amount of work to perform this use case. It
 
1441
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
1442
        # being too low. If rpc_count increases, more network roundtrips have
 
1443
        # become necessary for this use case. Please do not adjust this number
 
1444
        # upwards without agreement from bzr's network support maintainers.
 
1445
        self.assertLength(12, self.hpss_calls)
 
1446
 
 
1447
    def test_verbose_branch_info(self):
 
1448
        self.setup_smart_server_with_call_log()
 
1449
        t = self.make_branch_and_tree('branch')
 
1450
        self.build_tree_contents([('branch/foo', 'thecontents')])
 
1451
        t.add("foo")
 
1452
        t.commit("message")
 
1453
        self.reset_smart_call_log()
 
1454
        out, err = self.run_bzr(['info', '-v', self.get_url('branch')])
 
1455
        # This figure represent the amount of work to perform this use case. It
 
1456
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
1457
        # being too low. If rpc_count increases, more network roundtrips have
 
1458
        # become necessary for this use case. Please do not adjust this number
 
1459
        # upwards without agreement from bzr's network support maintainers.
 
1460
        self.assertLength(16, self.hpss_calls)