~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

  • Committer: Alexander Belchenko
  • Date: 2008-02-16 10:03:17 UTC
  • mfrom: (3224 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3230.
  • Revision ID: bialix@ukr.net-20080216100317-xg1hdw306evlgt94
merge bzr.dev; update for 1.3; $BZR_LOG used in trace.py module (again), not in the main bzr script (req. by 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):