~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-01-17 06:17:14 UTC
  • mfrom: (3092.4.5 doc)
  • Revision ID: pqm@pqm.ubuntu.com-20080117061714-b11thhb6x5jbgwpl
better docs on release process

Show diffs side-by-side

added added

removed removed

Lines of Context:
829
829
        tree.add('')
830
830
        rev_id1_utf8 = u'\xc8'.encode('utf-8')
831
831
        rev_id2_utf8 = u'\xc9'.encode('utf-8')
832
 
        tree.commit('1st commit', rev_id=rev_id1_utf8)
833
 
        tree.commit('2nd commit', rev_id=rev_id2_utf8)
 
832
        r1 = tree.commit('1st commit', rev_id=rev_id1_utf8)
 
833
        r1 = tree.commit('2nd commit', rev_id=rev_id2_utf8)
834
834
        tree.unlock()
835
835
 
836
 
        response = request.execute(backing.local_abspath(''))
837
 
        self.assertEqual(None, response)
838
 
        response = request.do_body("%s\n%s\n1" % (rev_id2_utf8, rev_id1_utf8))
 
836
        response = request.execute(backing.local_abspath(''), rev_id2_utf8)
839
837
        self.assertEqual(('ok',), response.args)
840
838
        from cStringIO import StringIO
841
839
        parser = pack.ContainerPushParser()
855
853
            backing)
856
854
        repo = self.make_repository('.')
857
855
        rev_id1_utf8 = u'\xc8'.encode('utf-8')
858
 
        response = request.execute(backing.local_abspath(''))
859
 
        self.assertEqual(None, response)
860
 
        response = request.do_body("%s\n\n1" % (rev_id1_utf8,))
 
856
        response = request.execute(backing.local_abspath(''), rev_id1_utf8)
 
857
        # There's no error initially.
 
858
        self.assertTrue(response.is_successful())
 
859
        self.assertEqual(('ok',), response.args)
 
860
        # We only get an error while streaming the body.
 
861
        body = list(response.body_stream)
 
862
        last_chunk = body[-1]
 
863
        self.assertIsInstance(last_chunk, FailedSmartServerResponse)
861
864
        self.assertEqual(
862
 
            FailedSmartServerResponse(('NoSuchRevision', )),
863
 
            response)
 
865
            last_chunk,
 
866
            FailedSmartServerResponse(('NoSuchRevision', rev_id1_utf8)))
864
867
 
865
868
 
866
869
class TestSmartServerIsReadonly(tests.TestCaseWithTransport):
932
935
            smart.request.request_handlers.get('Repository.lock_write'),
933
936
            smart.repository.SmartServerRepositoryLockWrite)
934
937
        self.assertEqual(
 
938
            smart.request.request_handlers.get(
 
939
                'Repository.chunked_stream_knit_data_for_revisions'),
 
940
            smart.repository.SmartServerRepositoryStreamKnitDataForRevisions)
 
941
        self.assertEqual(
935
942
            smart.request.request_handlers.get('Repository.tarball'),
936
943
            smart.repository.SmartServerRepositoryTarball)
937
944
        self.assertEqual(