~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Ian Clatworthy
  • Date: 2007-07-03 07:37:11 UTC
  • mfrom: (2520.3.1 110448)
  • mto: This revision was merged to the branch mainline in revision 2576.
  • Revision ID: ian.clatworthy@internode.on.net-20070703073711-grb8q45os61y904x
(Vincent Ladeuil) Merge fix for #110448 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1638
1638
        self.transport_readonly_server = None
1639
1639
        self.__vfs_server = None
1640
1640
 
1641
 
    def get_transport(self):
1642
 
        """Return a writeable transport for the test scratch space"""
1643
 
        t = get_transport(self.get_url())
 
1641
    def get_transport(self, relpath=None):
 
1642
        """Return a writeable transport.
 
1643
 
 
1644
        This transport is for the test scratch space relative to
 
1645
        "self._test_root""
 
1646
        
 
1647
        :param relpath: a path relative to the base url.
 
1648
        """
 
1649
        t = get_transport(self.get_url(relpath))
1644
1650
        self.assertFalse(t.is_readonly())
1645
1651
        return t
1646
1652
 
1647
 
    def get_readonly_transport(self):
 
1653
    def get_readonly_transport(self, relpath=None):
1648
1654
        """Return a readonly transport for the test scratch space
1649
1655
        
1650
1656
        This can be used to test that operations which should only need
1651
1657
        readonly access in fact do not try to write.
 
1658
 
 
1659
        :param relpath: a path relative to the base url.
1652
1660
        """
1653
 
        t = get_transport(self.get_readonly_url())
 
1661
        t = get_transport(self.get_readonly_url(relpath))
1654
1662
        self.assertTrue(t.is_readonly())
1655
1663
        return t
1656
1664
 
1687
1695
        These should only be downwards relative, not upwards.
1688
1696
        """
1689
1697
        base = self.get_readonly_server().get_url()
1690
 
        if relpath is not None:
1691
 
            if not base.endswith('/'):
1692
 
                base = base + '/'
1693
 
            base = base + relpath
1694
 
        return base
 
1698
        return self._adjust_url(base, relpath)
1695
1699
 
1696
1700
    def get_vfs_only_server(self):
1697
1701
        """Get the vfs only read/write server instance.