~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-08 03:35:09 UTC
  • mfrom: (4934.3.4 cleanup)
  • Revision ID: pqm@pqm.ubuntu.com-20100108033509-5dp440ermqsavlhr
(mbp) rename Server.setUp and tearDown to start_server and stop_server

Show diffs side-by-side

added added

removed removed

Lines of Context:
430
430
    def test_setUp(self):
431
431
        backing_transport = MemoryTransport()
432
432
        server = ChrootServer(backing_transport)
433
 
        server.setUp()
 
433
        server.start_server()
434
434
        try:
435
435
            self.assertTrue(server.scheme in _get_protocol_handlers().keys())
436
436
        finally:
437
 
            server.tearDown()
 
437
            server.stop_server()
438
438
 
439
 
    def test_tearDown(self):
 
439
    def test_stop_server(self):
440
440
        backing_transport = MemoryTransport()
441
441
        server = ChrootServer(backing_transport)
442
 
        server.setUp()
443
 
        server.tearDown()
 
442
        server.start_server()
 
443
        server.stop_server()
444
444
        self.assertFalse(server.scheme in _get_protocol_handlers().keys())
445
445
 
446
446
    def test_get_url(self):
447
447
        backing_transport = MemoryTransport()
448
448
        server = ChrootServer(backing_transport)
449
 
        server.setUp()
 
449
        server.start_server()
450
450
        try:
451
451
            self.assertEqual('chroot-%d:///' % id(server), server.get_url())
452
452
        finally:
453
 
            server.tearDown()
 
453
            server.stop_server()
454
454
 
455
455
 
456
456
class PathFilteringDecoratorTransportTest(TestCase):
460
460
        # The abspath is always relative to the base of the backing transport.
461
461
        server = PathFilteringServer(get_transport('memory:///foo/bar/'),
462
462
            lambda x: x)
463
 
        server.setUp()
 
463
        server.start_server()
464
464
        transport = get_transport(server.get_url())
465
465
        self.assertEqual(server.get_url(), transport.abspath('/'))
466
466
 
467
467
        subdir_transport = transport.clone('subdir')
468
468
        self.assertEqual(server.get_url(), subdir_transport.abspath('/'))
469
 
        server.tearDown()
 
469
        server.stop_server()
470
470
 
471
471
    def make_pf_transport(self, filter_func=None):
472
472
        """Make a PathFilteringTransport backed by a MemoryTransport.
477
477
            filter_func = lambda x: x
478
478
        server = PathFilteringServer(
479
479
            get_transport('memory:///foo/bar/'), filter_func)
480
 
        server.setUp()
481
 
        self.addCleanup(server.tearDown)
 
480
        server.start_server()
 
481
        self.addCleanup(server.stop_server)
482
482
        return get_transport(server.get_url())
483
483
 
484
484
    def test__filter(self):