~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: Aaron Bentley
  • Date: 2007-08-20 13:07:12 UTC
  • mfrom: (2732 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2733.
  • Revision ID: abentley@panoramicfeedback.com-20070820130712-buopmg528zcgwyxc
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
298
298
    def test_parameters(self):
299
299
        transport = MemoryTransport()
300
300
        self.assertEqual(True, transport.listable())
301
 
        self.assertEqual(False, transport.should_cache())
302
301
        self.assertEqual(False, transport.is_readonly())
303
302
 
304
303
    def test_iter_files_recursive(self):
414
413
        # connect to . in readonly mode
415
414
        transport = readonly.ReadonlyTransportDecorator('readonly+.')
416
415
        self.assertEqual(True, transport.listable())
417
 
        self.assertEqual(False, transport.should_cache())
418
416
        self.assertEqual(True, transport.is_readonly())
419
417
 
420
418
    def test_http_parameters(self):
428
426
            self.failUnless(isinstance(transport,
429
427
                                       readonly.ReadonlyTransportDecorator))
430
428
            self.assertEqual(False, transport.listable())
431
 
            self.assertEqual(True, transport.should_cache())
432
429
            self.assertEqual(True, transport.is_readonly())
433
430
        finally:
434
431
            server.tearDown()
443
440
        return fakenfs.FakeNFSTransportDecorator('fakenfs+' + url)
444
441
 
445
442
    def test_local_parameters(self):
446
 
        # the listable, should_cache and is_readonly parameters
 
443
        # the listable and is_readonly parameters
447
444
        # are not changed by the fakenfs decorator
448
445
        transport = self.get_nfs_transport('.')
449
446
        self.assertEqual(True, transport.listable())
450
 
        self.assertEqual(False, transport.should_cache())
451
447
        self.assertEqual(False, transport.is_readonly())
452
448
 
453
449
    def test_http_parameters(self):
454
 
        # the listable, should_cache and is_readonly parameters
 
450
        # the listable and is_readonly parameters
455
451
        # are not changed by the fakenfs decorator
456
452
        from bzrlib.tests.HttpServer import HttpServer
457
453
        # connect to . via http which is not listable
462
458
            self.assertIsInstance(
463
459
                transport, bzrlib.transport.fakenfs.FakeNFSTransportDecorator)
464
460
            self.assertEqual(False, transport.listable())
465
 
            self.assertEqual(True, transport.should_cache())
466
461
            self.assertEqual(True, transport.is_readonly())
467
462
        finally:
468
463
            server.tearDown()
695
690
    """Tests for transport reuse"""
696
691
 
697
692
    def test_reuse_same_transport(self):
698
 
        t1 = get_transport('http://foo/')
 
693
        possible_transports = []
 
694
        t1 = get_transport('http://foo/',
 
695
                           possible_transports=possible_transports)
 
696
        self.assertEqual([t1], possible_transports)
699
697
        t2 = get_transport('http://foo/', possible_transports=[t1])
700
698
        self.assertIs(t1, t2)
701
699