~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/whitebox.py

  • Committer: Robert Collins
  • Date: 2005-09-28 05:25:54 UTC
  • mfrom: (1185.1.42)
  • mto: (1092.2.18)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050928052554-beb985505f77ea6a
update symlink branch to integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/python
2
 
 
3
1
import os
4
2
import unittest
5
3
 
11
9
class TestBranch(TestCaseInTempDir):
12
10
 
13
11
    def test_unknowns(self):
14
 
        b = Branch('.', init=True)
 
12
        b = Branch.initialize('.')
15
13
 
16
14
        self.build_tree(['hello.txt',
17
15
                         'hello.txt~'])
22
20
    def test_no_changes(self):
23
21
        from bzrlib.errors import PointlessCommit
24
22
        
25
 
        b = Branch('.', init=True)
 
23
        b = Branch.initialize('.')
26
24
 
27
25
        self.build_tree(['hello.txt'])
28
26
 
76
74
 
77
75
    def test_pending_merges(self):
78
76
        """Tracking pending-merged revisions."""
79
 
        b = Branch('.', init=True)
 
77
        b = Branch.initialize('.')
80
78
 
81
79
        self.assertEquals(b.pending_merges(), [])
82
80
        b.add_pending_merge('foo@azkhazan-123123-abcabc')
99
97
        
100
98
    def test_revert(self):
101
99
        """Test selected-file revert"""
102
 
        b = Branch('.', init=True)
 
100
        b = Branch.initialize('.')
103
101
 
104
102
        self.build_tree(['hello.txt'])
105
103
        file('hello.txt', 'w').write('initial hello')
126
124
 
127
125
    def test_rename_dirs(self):
128
126
        """Test renaming directories and the files within them."""
129
 
        b = Branch('.', init=True)
 
127
        b = Branch.initialize('.')
130
128
        self.build_tree(['dir/', 'dir/sub/', 'dir/sub/file'])
131
129
        b.add(['dir', 'dir/sub', 'dir/sub/file'])
132
130
 
197
195
            # directory, or nearby
198
196
            os.chdir(dtmp)
199
197
 
200
 
            self.assertEqual(rp('foo/bar/quux'), 'foo/bar/quux')
 
198
            FOO_BAR_QUUX = os.path.join('foo', 'bar', 'quux')
 
199
            self.assertEqual(rp('foo/bar/quux'), FOO_BAR_QUUX)
201
200
 
202
201
            self.assertEqual(rp('foo'), 'foo')
203
202