~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-02-06 01:45:28 UTC
  • mfrom: (3211.5.4 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080206014528-rb8v4hl04mgxulb7
(robertc) Tune RemoteRepository.get_parent_map to not send duplicate
        results, and to compress the data,
        reducing round trips further. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
Tests for low-level protocol encoding are found in test_smart_transport.
25
25
"""
26
26
 
 
27
import bz2
27
28
from StringIO import StringIO
28
29
import tempfile
29
30
import tarfile
529
530
            request.execute, backing.local_abspath('subdir'))
530
531
 
531
532
 
 
533
class TestSmartServerRepositoryGetParentMap(tests.TestCaseWithTransport):
 
534
 
 
535
    def test_trivial_bzipped(self):
 
536
        # This tests that the wire encoding is actually bzipped
 
537
        backing = self.get_transport()
 
538
        request = smart.repository.SmartServerRepositoryGetParentMap(backing)
 
539
        tree = self.make_branch_and_memory_tree('.')
 
540
 
 
541
        self.assertEqual(None,
 
542
            request.execute(backing.local_abspath(''), 'missing-id'))
 
543
        # Note that it returns a body (of '' bzipped).
 
544
        self.assertEqual(
 
545
            SuccessfulSmartServerResponse(('ok', ), bz2.compress('')),
 
546
            request.do_body('\n\n0\n'))
 
547
 
 
548
 
532
549
class TestSmartServerRepositoryGetRevisionGraph(tests.TestCaseWithTransport):
533
550
 
534
551
    def test_none_argument(self):