/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_smart.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-28 15:59:39 UTC
  • mfrom: (6316 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6318.
  • Revision ID: jelmer@samba.org-20111128155939-709ll9ta5aqduig0
Merge bzr.dev.

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,
2014
2015
            request.execute('', ))
2015
2016
 
2016
2017
 
 
2018
class TestSmartServerRepositoryGetRevisionSignatureText(
 
2019
        tests.TestCaseWithMemoryTransport):
 
2020
 
 
2021
    def test_get_signature(self):
 
2022
        backing = self.get_transport()
 
2023
        request = smart_repo.SmartServerRepositoryGetRevisionSignatureText(
 
2024
            backing)
 
2025
        bb = self.make_branch_builder('.')
 
2026
        bb.build_commit(rev_id='A')
 
2027
        repo = bb.get_branch().repository
 
2028
        strategy = gpg.LoopbackGPGStrategy(None)
 
2029
        self.addCleanup(repo.lock_write().unlock)
 
2030
        repo.start_write_group()
 
2031
        repo.sign_revision('A', strategy)
 
2032
        repo.commit_write_group()
 
2033
        expected_body = (
 
2034
            '-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
 
2035
            Testament.from_revision(repo, 'A').as_short_text() +
 
2036
            '-----END PSEUDO-SIGNED CONTENT-----\n')
 
2037
        self.assertEqual(
 
2038
            smart_req.SmartServerResponse(('ok', ), expected_body),
 
2039
            request.execute('', 'A'))
 
2040
 
 
2041
 
2017
2042
class TestSmartServerRepositoryMakeWorkingTrees(
2018
2043
        tests.TestCaseWithMemoryTransport):
2019
2044
 
2461
2486
            smart_repo.SmartServerRepositoryGetRevIdForRevno)
2462
2487
        self.assertHandlerEqual('Repository.get_revision_graph',
2463
2488
            smart_repo.SmartServerRepositoryGetRevisionGraph)
 
2489
        self.assertHandlerEqual('Repository.get_revision_signature_text',
 
2490
            smart_repo.SmartServerRepositoryGetRevisionSignatureText)
2464
2491
        self.assertHandlerEqual('Repository.get_stream',
2465
2492
            smart_repo.SmartServerRepositoryGetStream)
2466
2493
        self.assertHandlerEqual('Repository.get_stream_1.19',