~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_urlutils.py

  • Committer: v.ladeuil+lp at free
  • Date: 2007-05-18 18:20:31 UTC
  • mto: (2485.8.44 bzr.connection.sharing)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070518182031-gbg2cgidv5l20x9p
Takes Robert comments into account.

* bzrlib/transport/ftp.py:
(FtpTransport.__init__): Write a better explanation.

* bzrlib/tests/test_init.py:
(InstrumentedTransport): Just make hooks a class attribute.
(InstrumentedTransport._get_FTP): Run hook directly in the for
loop.
(TransportHooks.run_hook, TransportHooks.uninstall_hook): Not
needed. The hooks should be cleaned up by the test itself.
(TestInit.setUp.cleanup): Resset to default hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
570
570
        #   u'/dod\xe9' => '/dod\xc3\xa9'
571
571
        url = urlutils.local_path_to_url('.')
572
572
        self.assertEndsWith(url, '/dod%C3%A9')
573
 
 
574
 
 
575
 
class TestDeriveToLocation(TestCase):
576
 
    """Test that the mapping of FROM_LOCATION to TO_LOCATION works."""
577
 
 
578
 
    def test_to_locations_derived_from_paths(self):
579
 
        derive = urlutils.derive_to_location
580
 
        self.assertEqual("bar", derive("bar"))
581
 
        self.assertEqual("bar", derive("../bar"))
582
 
        self.assertEqual("bar", derive("/foo/bar"))
583
 
        self.assertEqual("bar", derive("c:/foo/bar"))
584
 
        self.assertEqual("bar", derive("c:bar"))
585
 
 
586
 
    def test_to_locations_derived_from_urls(self):
587
 
        derive = urlutils.derive_to_location
588
 
        self.assertEqual("bar", derive("http://foo/bar"))
589
 
        self.assertEqual("bar", derive("bzr+ssh://foo/bar"))
590
 
        self.assertEqual("foo-bar", derive("lp:foo-bar"))