~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/blackbox.py

  • Committer: Robert Collins
  • Date: 2006-04-24 01:45:23 UTC
  • mto: (364.1.3 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 366.
  • Revision ID: robertc@robertcollins.net-20060424014523-ef18f22034f17ec2
Backout debugging tweak to fai.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
    def test_clean_tree(self):
10
10
        self.runbzr('init')
11
 
        self.runbzr('ignore *~')
12
 
        self.runbzr('ignore *.pyc')
13
11
        self.touch('name')
14
12
        self.touch('name~')
15
13
        assert os.path.lexists('name~')
17
15
        self.runbzr('clean-tree')
18
16
        assert os.path.lexists('name~')
19
17
        assert not os.path.lexists('name')
20
 
        self.touch('name')
21
18
        self.runbzr('clean-tree --detritus')
22
 
        assert os.path.lexists('name')
23
19
        assert not os.path.lexists('name~')
24
20
        assert os.path.lexists('name.pyc')
25
21
        self.runbzr('clean-tree --ignored')
26
 
        assert os.path.lexists('name')
27
 
        assert not os.path.lexists('name.pyc')
28
 
        self.runbzr('clean-tree --unknown')
29
 
        assert not os.path.lexists('name')
30
 
        self.touch('name')
31
 
        self.touch('name~')
32
 
        self.touch('name.pyc')
33
 
        self.runbzr('clean-tree --unknown --ignored')
34
 
        assert not os.path.lexists('name')
35
 
        assert not os.path.lexists('name~')
36
22
        assert not os.path.lexists('name.pyc')
37
23
 
38
24
    def test_shelve(self):
57
43
        file('mypatch', 'wb').write(self.runbzr('diff', retcode=1, backtick=1))
58
44
        self.runbzr('revert')
59
45
        assert file('myfile', 'rb').read() == 'hello'
60
 
        self.runbzr('patch --silent mypatch')
 
46
        self.runbzr('patch mypatch')
61
47
        assert file('myfile', 'rb').read() == 'goodbye'
62
48
 
63
49
    def test_branch_history(self):
94
80
    def test_zap_branch(self):
95
81
        self.runbzr('init source')
96
82
        self.runbzr('checkout --lightweight source checkout')
97
 
        self.runbzr('zap --branch checkout', retcode=3)
98
 
        self.assertIs(True, os.path.exists('checkout'))
99
 
        self.assertIs(True, os.path.exists('source'))
100
 
        self.runbzr('branch source source2')
101
 
        self.runbzr('checkout --lightweight source2 checkout2')
102
 
        self.runbzr('zap --branch checkout2')
103
 
        self.assertIs(False, os.path.exists('checkout2'))
104
 
        self.assertIs(False, os.path.exists('source2'))
 
83
        self.runbzr('zap --branch checkout')
 
84
        self.assertIs(False, os.path.exists('checkout'))
 
85
        self.assertIs(False, os.path.exists('source'))
105
86
 
106
87
    def test_branches(self):
107
88
        self.runbzr('init source')
117
98
        self.assertIs(True, 'checkout' not in lines)
118
99
        self.assertIs(True, 'checkout/.bzr/subcheckout' not in lines)
119
100
 
120
 
    def test_import_upstream(self):
121
 
        self.runbzr('init source')
122
 
        os.mkdir('source/src')
123
 
        f = file('source/src/myfile', 'wb')
124
 
        f.write('hello?')
125
 
        f.close()
126
 
        os.chdir('source')
127
 
        self.runbzr('add')
128
 
        self.runbzr('commit -m hello')
129
 
        self.runbzr('export ../source-0.1.tar.gz')
130
 
        self.runbzr('export ../source-0.1.tar.bz2')
131
 
        self.runbzr('export ../source-0.1')
132
 
        self.runbzr('init ../import')
133
 
        os.chdir('../import')
134
 
        self.runbzr('import ../source-0.1.tar.gz')
135
 
        self.failUnlessExists('src/myfile')
136
 
        result = self.runbzr('import ../source-0.1.tar.gz', retcode=3)[1]
137
 
        self.assertContainsRe(result, 'Working tree has uncommitted changes')
138
 
        self.runbzr('commit -m commit')
139
 
        self.runbzr('import ../source-0.1.tar.gz')
140
 
        os.chdir('..')
141
 
        self.runbzr('init import2')
142
 
        self.runbzr('import source-0.1.tar.gz import2')
143
 
        self.failUnlessExists('import2/src/myfile')
144
 
        self.runbzr('import source-0.1.tar.gz import3')
145
 
        self.failUnlessExists('import3/src/myfile')
146
 
        self.runbzr('import source-0.1.tar.bz2 import4')
147
 
        self.failUnlessExists('import4/src/myfile')
148
 
        self.runbzr('import source-0.1 import5')
149
 
        self.failUnlessExists('import5/src/myfile')
150
 
 
151
101
def test_suite():
152
102
    return makeSuite(TestBzrTools)