~bzr-pqm/bzr/bzr.dev

1530.2.1 by Robert Collins
Start tests for api usage.
1
The Transport API in bzrlib provides URL based access to network resources.
2
3
   >>> import os
1551.2.51 by abentley
Fixed transport doctest
4
   >>> from bzrlib.osutils import getcwd, dirname
1530.2.1 by Robert Collins
Start tests for api usage.
5
   >>> import bzrlib.transport as transport
6
   >>> root = transport.get_transport("file:///")
7
   >>>
8
9
Each Transport instance represents a single logical directory.
10
11
   >>> dir = transport.get_transport(".")
1551.2.50 by Aaron Bentley
Used osutils getcwd instead of replacing "\" with "/"
12
   >>> dir.base == getcwd() + '/'
1530.2.1 by Robert Collins
Start tests for api usage.
13
   True
14
15
You can change directories via the clone method:
16
17
   >>> parent = dir.clone('..')
1551.2.51 by abentley
Fixed transport doctest
18
   >>> parent.base == (dirname(getcwd()).rstrip('/') + '/')
1530.2.1 by Robert Collins
Start tests for api usage.
19
   True