~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testbranch.py

  • Committer: Robert Collins
  • Date: 2005-09-06 09:47:19 UTC
  • mfrom: (1092.1.45)
  • mto: (1185.1.10) (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: robertc@robertcollins.net-20050906094719-a7e1f8ed80fe4280
mergeĀ fromĀ upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
import os
18
 
from bzrlib.selftest import FunctionalTestCase
19
 
 
20
 
 
21
 
class FunctionalBranchTests(FunctionalTestCase):
22
 
 
 
17
from bzrlib.selftest import InTempDir
 
18
 
 
19
 
 
20
class TestAppendRevisions(InTempDir):
 
21
    """Test appending more than one revision"""
23
22
    def test_append_revisions(self):
24
 
        """Test appending more than one revision"""
25
23
        from bzrlib.branch import Branch
26
24
        br = Branch(".", init=True)
27
25
        br.append_revision("rev1")
29
27
        br.append_revision("rev2", "rev3")
30
28
        self.assertEquals(br.revision_history(), ["rev1", "rev2", "rev3"])
31
29
 
32
 
    def test_file_url(self):
33
 
        """Test accessing a branch by a file:/// url."""
34
 
        from bzrlib.branch import Branch, find_branch
35
 
        os.mkdir("foo")
36
 
        br = Branch("foo", init=True)
37
 
        br = None
38
 
        url = ("file://%s" % os.path.abspath("foo")).replace('\\', '/')
39
 
        br = find_branch(url, find_root=False)
40
 
        self.assertEqual(br.base, os.path.abspath("foo"))
41
30
 
42
31
# TODO: rewrite this as a regular unittest, without relying on the displayed output        
43
32
#         >>> from bzrlib.commit import commit