~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Martin Pool
  • Date: 2006-11-02 10:20:19 UTC
  • mfrom: (2114 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2119.
  • Revision ID: mbp@sourcefrog.net-20061102102019-9a5a02f485dff6f6
merge bzr.dev and reconcile several changes, also some test fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 by Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
897
897
        except NotImplementedError:
898
898
            raise TestSkipped("Transport %s has no bogus URL support." %
899
899
                              self._server.__class__)
 
900
        # This should be:  but SSH still connects on construction. No COOKIE!
 
901
        # self.assertRaises((ConnectionError, NoSuchFile), t.get, '.bzr/branch')
900
902
        try:
901
903
            t = bzrlib.transport.get_transport(url)
902
904
            t.get('.bzr/branch')
1117
1119
        # the abspath of "/" and "/foo/.." should result in the same location
1118
1120
        self.assertEqual(transport.abspath("/"), transport.abspath("/foo/.."))
1119
1121
 
 
1122
        self.assertEqual(transport.clone("/").abspath('foo'),
 
1123
                         transport.abspath("/foo"))
 
1124
 
1120
1125
    def test_local_abspath(self):
1121
1126
        transport = self.get_transport()
1122
1127
        try:
1309
1314
        self.assertEqual(d[2], (0, '0'))
1310
1315
        self.assertEqual(d[3], (3, '34'))
1311
1316
 
1312
 
    def test_get_smart_client(self):
1313
 
        """All transports must either give a smart client, or know they can't.
1314
 
 
1315
 
        For some transports such as http this might depend on probing to see 
1316
 
        what's actually present on the other end.  (But we can adjust for that 
1317
 
        in the future.)
 
1317
    def test_get_smart_medium(self):
 
1318
        """All transports must either give a smart medium, or know they can't.
1318
1319
        """
1319
1320
        transport = self.get_transport()
1320
1321
        try:
1321
 
            client = transport.get_smart_client()
1322
 
            # XXX: should be a more general class
1323
 
            self.assertIsInstance(client, smart.SmartStreamClient)
1324
 
        except NoSmartServer:
 
1322
            medium = transport.get_smart_medium()
 
1323
            self.assertIsInstance(medium, smart.SmartClientMedium)
 
1324
        except errors.NoSmartMedium:
1325
1325
            # as long as we got it we're fine
1326
1326
            pass
1327
1327