~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

  • Committer: Patch Queue Manager
  • Date: 2011-11-22 13:52:59 UTC
  • mfrom: (6270.1.23 hpss-branch-store)
  • Revision ID: pqm@pqm.ubuntu.com-20111122135259-dfjq13wb2z4ndbh6
(jelmer) Support HPSS calls for config stacks of remote branches and
 bzrdirs. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
817
817
        return branch_token, repo_token
818
818
 
819
819
 
 
820
class TestSmartServerBranchRequestPutConfigFile(TestLockedBranch):
 
821
 
 
822
    def test_with_content(self):
 
823
        backing = self.get_transport()
 
824
        request = smart_branch.SmartServerBranchPutConfigFile(backing)
 
825
        branch = self.make_branch('.')
 
826
        branch_token, repo_token = self.get_lock_tokens(branch)
 
827
        self.assertIs(None, request.execute('', branch_token, repo_token))
 
828
        self.assertEqual(
 
829
            smart_req.SmartServerResponse(('ok', )),
 
830
            request.do_body('foo bar baz'))
 
831
        self.assertEquals(
 
832
            branch.control_transport.get_bytes('branch.conf'),
 
833
            'foo bar baz')
 
834
        branch.unlock()
 
835
 
 
836
 
820
837
class TestSmartServerBranchRequestSetConfigOption(TestLockedBranch):
821
838
 
822
839
    def test_value_name(self):
1987
2004
        """Test that known methods are registered to the correct object."""
1988
2005
        self.assertHandlerEqual('Branch.get_config_file',
1989
2006
            smart_branch.SmartServerBranchGetConfigFile)
 
2007
        self.assertHandlerEqual('Branch.put_config_file',
 
2008
            smart_branch.SmartServerBranchPutConfigFile)
1990
2009
        self.assertHandlerEqual('Branch.get_parent',
1991
2010
            smart_branch.SmartServerBranchGetParent)
1992
2011
        self.assertHandlerEqual('Branch.get_tags_bytes',