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

  • Committer: Robert Collins
  • Date: 2009-05-23 20:57:12 UTC
  • mfrom: (4371 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4441.
  • Revision ID: robertc@robertcollins.net-20090523205712-lcwbfqk6vwavinuv
MergeĀ .dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for smart transport"""
18
18
 
776
776
    def test_pipe_like_stream_with_two_requests(self):
777
777
        # If two requests are read in one go, then two calls to
778
778
        # _serve_one_request should still process both of them as if they had
779
 
        # been received seperately.
 
779
        # been received separately.
780
780
        sample_request_bytes = 'command\n'
781
781
        to_server = StringIO(sample_request_bytes * 2)
782
782
        from_server = StringIO()
798
798
    def test_socket_stream_with_two_requests(self):
799
799
        # If two requests are read in one go, then two calls to
800
800
        # _serve_one_request should still process both of them as if they had
801
 
        # been received seperately.
 
801
        # been received separately.
802
802
        sample_request_bytes = 'command\n'
803
803
        server_sock, client_sock = self.portable_socket_pair()
804
804
        server = medium.SmartServerSocketStreamMedium(
1069
1069
        self._captureVar('BZR_NO_SMART_VFS', None)
1070
1070
        err = self.assertRaises(
1071
1071
            errors.NoSuchFile, self.transport.get, 'not%20a%20file')
1072
 
        self.assertEqual('not%20a%20file', err.path)
 
1072
        self.assertSubset([err.path], ['not%20a%20file', './not%20a%20file'])
1073
1073
 
1074
1074
    def test_simple_clone_conn(self):
1075
1075
        """Test that cloning reuses the same connection."""
1639
1639
        """
1640
1640
        # What we really want to test here is that SmartClientProtocolOne calls
1641
1641
        # accept_bytes(tuple_based_encoding_of_hello) and reads and parses the
1642
 
        # response of tuple-encoded (ok, 1).  Also, seperately we should test
 
1642
        # response of tuple-encoded (ok, 1).  Also, separately we should test
1643
1643
        # the error if the response is a non-understood version.
1644
1644
        input = StringIO('ok\x012\n')
1645
1645
        output = StringIO()
1910
1910
        """
1911
1911
        # What we really want to test here is that SmartClientProtocolTwo calls
1912
1912
        # accept_bytes(tuple_based_encoding_of_hello) and reads and parses the
1913
 
        # response of tuple-encoded (ok, 1).  Also, seperately we should test
 
1913
        # response of tuple-encoded (ok, 1).  Also, separately we should test
1914
1914
        # the error if the response is a non-understood version.
1915
1915
        input = StringIO(self.response_marker + 'success\nok\x012\n')
1916
1916
        output = StringIO()
2823
2823
    """
2824
2824
 
2825
2825
    def setUp(self):
 
2826
        tests.TestCase.setUp(self)
2826
2827
        self.writes = []
2827
2828
        self.responder = protocol.ProtocolThreeResponder(self.writes.append)
2828
2829