~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Patch Queue Manager
  • Date: 2011-12-30 15:51:59 UTC
  • mfrom: (6213.1.63 update-feature-flags)
  • Revision ID: pqm@pqm.ubuntu.com-20111230155159-qrgafyvytuitiq8u
(jelmer) Add {Repository, Branch, WorkingTree,
 BzrDir}.update_feature_flags methods. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
933
933
        # name.
934
934
        client.add_success_response_with_body(
935
935
            "Bazaar-NG meta directory, format 1\n", 'ok')
 
936
        client.add_success_response('stat', '0', '65535')
936
937
        client.add_success_response_with_body(
937
938
            reference_format.get_format_string(), 'ok')
938
939
        # PackRepository wants to do a stat
947
948
             ('call', 'BzrDir.find_repositoryV2', ('quack/',)),
948
949
             ('call', 'BzrDir.find_repository', ('quack/',)),
949
950
             ('call_expecting_body', 'get', ('/quack/.bzr/branch-format',)),
 
951
             ('call', 'stat', ('/quack/.bzr',)),
950
952
             ('call_expecting_body', 'get', ('/quack/.bzr/repository/format',)),
951
953
             ('call', 'stat', ('/quack/.bzr/repository',)),
952
954
             ],
966
968
        # name.
967
969
        client.add_success_response_with_body(
968
970
            "Bazaar-NG meta directory, format 1\n", 'ok')
 
971
        client.add_success_response('stat', '0', '65535')
969
972
        client.add_success_response_with_body(
970
973
            reference_format.get_format_string(), 'ok')
971
974
        # PackRepository wants to do a stat
979
982
            [('call', 'BzrDir.find_repositoryV3', ('quack/',)),
980
983
             ('call', 'BzrDir.find_repositoryV2', ('quack/',)),
981
984
             ('call_expecting_body', 'get', ('/quack/.bzr/branch-format',)),
 
985
             ('call', 'stat', ('/quack/.bzr',)),
982
986
             ('call_expecting_body', 'get', ('/quack/.bzr/repository/format',)),
983
987
             ('call', 'stat', ('/quack/.bzr/repository',)),
984
988
             ],
1270
1274
        verb = 'Branch.set_parent_location'
1271
1275
        self.disable_verb(verb)
1272
1276
        branch.set_parent('http://foo/')
1273
 
        self.assertLength(12, self.hpss_calls)
 
1277
        self.assertLength(13, self.hpss_calls)
1274
1278
 
1275
1279
 
1276
1280
class TestBranchGetTagsBytes(RemoteBranchTestCase):
1998
2002
        self.addCleanup(branch.unlock)
1999
2003
        self.reset_smart_call_log()
2000
2004
        branch._get_config().set_option('value', 'name')
2001
 
        self.assertLength(10, self.hpss_calls)
 
2005
        self.assertLength(11, self.hpss_calls)
2002
2006
        self.assertEqual('value', branch._get_config().get_option('name'))
2003
2007
 
2004
2008
    def test_backwards_compat_set_option_with_dict(self):
2012
2016
        config = branch._get_config()
2013
2017
        value_dict = {'ascii': 'a', u'unicode \N{WATCH}': u'\N{INTERROBANG}'}
2014
2018
        config.set_option(value_dict, 'name')
2015
 
        self.assertLength(10, self.hpss_calls)
 
2019
        self.assertLength(11, self.hpss_calls)
2016
2020
        self.assertEqual(value_dict, branch._get_config().get_option('name'))
2017
2021
 
2018
2022
 
2138
2142
        self.reset_smart_call_log()
2139
2143
        self.assertEquals((0, ),
2140
2144
            branch.revision_id_to_dotted_revno('null:'))
2141
 
        self.assertLength(7, self.hpss_calls)
 
2145
        self.assertLength(8, self.hpss_calls)
2142
2146
 
2143
2147
 
2144
2148
class TestBzrDirGetSetConfig(RemoteBzrDirTestCase):
2160
2164
        self.reset_smart_call_log()
2161
2165
        config = bzrdir.get_config()
2162
2166
        config.set_default_stack_on('/')
2163
 
        self.assertLength(3, self.hpss_calls)
 
2167
        self.assertLength(4, self.hpss_calls)
2164
2168
 
2165
2169
    def test_backwards_compat_get_option(self):
2166
2170
        self.setup_smart_server_with_call_log()
2170
2174
        self.reset_smart_call_log()
2171
2175
        self.assertEqual(None,
2172
2176
            bzrdir._get_config().get_option('default_stack_on'))
2173
 
        self.assertLength(3, self.hpss_calls)
 
2177
        self.assertLength(4, self.hpss_calls)
2174
2178
 
2175
2179
 
2176
2180
class TestTransportIsReadonly(tests.TestCase):