~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_transport.py

  • Committer: Robert Collins
  • Date: 2007-04-24 10:40:22 UTC
  • mto: (2432.3.5 hpss-vfs-fallback)
  • mto: This revision was merged to the branch mainline in revision 2463.
  • Revision ID: robertc@lifelesswks.robertcollins.net-20070424104022-308ab78a663c23f7
Add SuccessfulSmartServerResponse.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1910
1910
        self.assertEqual('', decoder.unused_data)
1911
1911
 
1912
1912
 
 
1913
class TestSuccessfulSmartServerResponse(tests.TestCase):
 
1914
 
 
1915
    def test_construct(self):
 
1916
        response = request.SuccessfulSmartServerResponse(('foo', 'bar'))
 
1917
        self.assertEqual(('foo', 'bar'), response.args)
 
1918
        self.assertEqual(None, response.body)
 
1919
        response = request.SuccessfulSmartServerResponse(('foo', 'bar'), 'bytes')
 
1920
        self.assertEqual(('foo', 'bar'), response.args)
 
1921
        self.assertEqual('bytes', response.body)
 
1922
 
 
1923
    def test_is_successful(self):
 
1924
        """is_successful should return True for SuccessfulSmartServerResponse."""
 
1925
        response = request.SuccessfulSmartServerResponse(('error',))
 
1926
        self.assertEqual(True, response.is_successful())
 
1927
 
 
1928
 
 
1929
 
1913
1930
class FakeHTTPMedium(object):
1914
1931
    def __init__(self):
1915
1932
        self.written_request = None