~benoit.pierre/bzrtools/shell_improvements

« back to all changes in this revision

Viewing changes to tests/blackbox.py

  • Committer: Benoît Pierre
  • Date: 2009-08-02 12:55:24 UTC
  • mfrom: (682.1.36 bzrtools)
  • Revision ID: benoit.pierre@gmail.com-20090802125524-1p2oot1y2l0y3o9w
Merge with upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
    def touch(filename):
14
14
        file(filename, 'wb').write('')
15
15
 
16
 
    def test_clean_tree(self):
17
 
        self.run_bzr('init')
18
 
        self.run_bzr('ignore *~')
19
 
        self.run_bzr('ignore *.pyc')
20
 
        self.touch('name')
21
 
        self.touch('name~')
22
 
        assert os.path.lexists('name~')
23
 
        self.touch('name.pyc')
24
 
        self.run_bzr('clean-tree --force')
25
 
        assert os.path.lexists('name~')
26
 
        assert not os.path.lexists('name')
27
 
        self.touch('name')
28
 
        self.run_bzr('clean-tree --detritus --force')
29
 
        assert os.path.lexists('name')
30
 
        assert not os.path.lexists('name~')
31
 
        assert os.path.lexists('name.pyc')
32
 
        self.run_bzr('clean-tree --ignored --force')
33
 
        assert os.path.lexists('name')
34
 
        assert not os.path.lexists('name.pyc')
35
 
        self.run_bzr('clean-tree --unknown --force')
36
 
        assert not os.path.lexists('name')
37
 
        self.touch('name')
38
 
        self.touch('name~')
39
 
        self.touch('name.pyc')
40
 
        self.run_bzr('clean-tree --unknown --ignored --force')
41
 
        assert not os.path.lexists('name')
42
 
        assert not os.path.lexists('name~')
43
 
        assert not os.path.lexists('name.pyc')
44
 
 
45
16
    def test_shelve(self):
46
17
        self.run_bzr('init')
47
18
        self.run_bzr('commit -m uc --unchanged')
198
169
        self.assertEqual(os.lstat(checkout2.abspath('file')).st_ino,
199
170
                         os.lstat(source.abspath('file')).st_ino)
200
171
 
 
172
    def test_create_mirror(self):
 
173
        source = self.make_branch_and_tree('source')
 
174
        source.commit('message')
 
175
        self.run_bzr('create-mirror source target')
 
176
        target = branch.Branch.open('target')
 
177
        self.assertEqual(source.last_revision(), target.last_revision())
 
178
        self.assertEqual(source.branch.base, target.get_public_branch())
 
179
 
201
180
 
202
181
def test_suite():
203
182
    return makeSuite(TestBzrTools)