/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

Reinstate the use of the Branch.get_config_file verb.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1332
1332
        self.assertEqual('rejection message', err.msg)
1333
1333
 
1334
1334
 
1335
 
class TestBranchControlGetBranchConf(tests.TestCaseWithMemoryTransport):
 
1335
class TestBranchControlGetBranchConf(RemoteBranchTestCase):
1336
1336
    """Getting the branch configuration should use an abstract method not vfs.
1337
1337
    """
1338
1338
 
1339
1339
    def test_get_branch_conf(self):
1340
 
        raise tests.KnownFailure('branch.conf is not retrieved by get_config_file')
1341
 
        ## # We should see that branch.get_config() does a single rpc to get the
1342
 
        ## # remote configuration file, abstracting away where that is stored on
1343
 
        ## # the server.  However at the moment it always falls back to using the
1344
 
        ## # vfs, and this would need some changes in config.py.
 
1340
        # We should see that branch.get_config() does a single rpc to get the
 
1341
        # remote configuration file, abstracting away where that is stored on
 
1342
        # the server.  However at the moment it always falls back to using the
 
1343
        # vfs, and this would need some changes in config.py.
1345
1344
 
1346
 
        ## # in an empty branch we decode the response properly
1347
 
        ## client = FakeClient([(('ok', ), '# config file body')], self.get_url())
1348
 
        ## # we need to make a real branch because the remote_branch.control_files
1349
 
        ## # will trigger _ensure_real.
1350
 
        ## branch = self.make_branch('quack')
1351
 
        ## transport = branch.bzrdir.root_transport
1352
 
        ## # we do not want bzrdir to make any remote calls
1353
 
        ## bzrdir = RemoteBzrDir(transport, _client=False)
1354
 
        ## branch = RemoteBranch(bzrdir, None, _client=client)
1355
 
        ## config = branch.get_config()
1356
 
        ## self.assertEqual(
1357
 
        ##     [('call_expecting_body', 'Branch.get_config_file', ('quack/',))],
1358
 
        ##     client._calls)
 
1345
        # in an empty branch we decode the response properly
 
1346
        client = FakeClient()
 
1347
        client.add_expected_call(
 
1348
            'Branch.get_stacked_on_url', ('memory:///',),
 
1349
            'error', ('NotStacked',),)
 
1350
        client.add_success_response_with_body('# config file body', 'ok')
 
1351
        transport = MemoryTransport()
 
1352
        branch = self.make_remote_branch(transport, client)
 
1353
        config = branch.get_config()
 
1354
        config.has_explicit_nickname()
 
1355
        self.assertEqual(
 
1356
            [('call', 'Branch.get_stacked_on_url', ('memory:///',)),
 
1357
             ('call_expecting_body', 'Branch.get_config_file', ('memory:///',))],
 
1358
            client._calls)
1359
1359
 
1360
1360
 
1361
1361
class TestBranchLockWrite(RemoteBranchTestCase):