~jelmer/ubuntu/maverick/bzr/2.2.5

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-03-10 14:11:59 UTC
  • mfrom: (1.2.1 upstream) (3.1.68 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090310141159-lwzzo5c1fwrtzgj4
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
    def test_make_repository(self):
28
28
        out, err = self.run_bzr("init-repository a")
 
29
        self.assertEqual(out,
 
30
"""Shared repository with trees (format: pack-0.92)
 
31
Location:
 
32
  shared repository: a
 
33
""")
 
34
        self.assertEqual(err, "")
 
35
        dir = BzrDir.open('a')
 
36
        self.assertIs(dir.open_repository().is_shared(), True)
 
37
        self.assertRaises(errors.NotBranchError, dir.open_branch)
 
38
        self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)
 
39
 
 
40
    def test_make_repository_quiet(self):
 
41
        out, err = self.run_bzr("init-repository a -q")
29
42
        self.assertEqual(out, "")
30
43
        self.assertEqual(err, "")
31
44
        dir = BzrDir.open('a')
32
45
        self.assertIs(dir.open_repository().is_shared(), True)
33
46
        self.assertRaises(errors.NotBranchError, dir.open_branch)
34
 
        self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)        
 
47
        self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)
35
48
 
36
49
    def test_init_repo_existing_dir(self):
37
50
        """Make repo in existing directory.
38
 
        
 
51
 
39
52
        (Malone #38331)
40
53
        """
41
54
        out, err = self.run_bzr("init-repository .")
95
108
        self.run_bzr("init-repo --no-trees notrees")
96
109
        repo = BzrDir.open("notrees").open_repository()
97
110
        self.assertEqual(False, repo.make_working_trees())
 
111
 
 
112
    def test_init_repo_smart_acceptance(self):
 
113
        # The amount of hpss calls made on init-repo to a smart server should
 
114
        # be fixed.
 
115
        self.setup_smart_server_with_call_log()
 
116
        self.run_bzr(['init-repo', self.get_url('repo')])
 
117
        rpc_count = len(self.hpss_calls)
 
118
        # This figure represent the amount of work to perform this use case. It
 
119
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
120
        # being too low. If rpc_count increases, more network roundtrips have
 
121
        # become necessary for this use case. Please do not adjust this number
 
122
        # upwards without agreement from bzr's network support maintainers.
 
123
        self.assertEqual(16, rpc_count)