~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

(jelmer) Add HPSS call for ``Repository.get_signature_text``. (Jelmer
 Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    server,
47
47
    vfs,
48
48
    )
 
49
from bzrlib.testament import Testament
49
50
from bzrlib.tests import test_server
50
51
from bzrlib.transport import (
51
52
    chroot,
1984
1985
            request.execute('', ))
1985
1986
 
1986
1987
 
 
1988
class TestSmartServerRepositoryGetRevisionSignatureText(
 
1989
        tests.TestCaseWithMemoryTransport):
 
1990
 
 
1991
    def test_get_signature(self):
 
1992
        backing = self.get_transport()
 
1993
        request = smart_repo.SmartServerRepositoryGetRevisionSignatureText(
 
1994
            backing)
 
1995
        bb = self.make_branch_builder('.')
 
1996
        bb.build_commit(rev_id='A')
 
1997
        repo = bb.get_branch().repository
 
1998
        strategy = gpg.LoopbackGPGStrategy(None)
 
1999
        self.addCleanup(repo.lock_write().unlock)
 
2000
        repo.start_write_group()
 
2001
        repo.sign_revision('A', strategy)
 
2002
        repo.commit_write_group()
 
2003
        expected_body = (
 
2004
            '-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
 
2005
            Testament.from_revision(repo, 'A').as_short_text() +
 
2006
            '-----END PSEUDO-SIGNED CONTENT-----\n')
 
2007
        self.assertEqual(
 
2008
            smart_req.SmartServerResponse(('ok', ), expected_body),
 
2009
            request.execute('', 'A'))
 
2010
 
 
2011
 
1987
2012
class TestSmartServerRepositoryMakeWorkingTrees(
1988
2013
        tests.TestCaseWithMemoryTransport):
1989
2014
 
2431
2456
            smart_repo.SmartServerRepositoryGetRevIdForRevno)
2432
2457
        self.assertHandlerEqual('Repository.get_revision_graph',
2433
2458
            smart_repo.SmartServerRepositoryGetRevisionGraph)
 
2459
        self.assertHandlerEqual('Repository.get_revision_signature_text',
 
2460
            smart_repo.SmartServerRepositoryGetRevisionSignatureText)
2434
2461
        self.assertHandlerEqual('Repository.get_stream',
2435
2462
            smart_repo.SmartServerRepositoryGetStream)
2436
2463
        self.assertHandlerEqual('Repository.get_stream_1.19',