~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/blackbox.py

  • Committer: Aaron Bentley
  • Date: 2007-06-10 17:55:08 UTC
  • mfrom: (531.2.2 bzrtools)
  • Revision ID: aaron.bentley@utoronto.ca-20070610175508-gex1oxvmfv0qoagi
Merge whitespace cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
        self.runbzr('clean-tree')
18
18
        assert os.path.lexists('name~')
19
19
        assert not os.path.lexists('name')
 
20
        self.touch('name')
20
21
        self.runbzr('clean-tree --detritus')
 
22
        assert os.path.lexists('name')
21
23
        assert not os.path.lexists('name~')
22
24
        assert os.path.lexists('name.pyc')
23
25
        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~')
24
36
        assert not os.path.lexists('name.pyc')
25
37
 
26
38
    def test_shelve(self):
45
57
        file('mypatch', 'wb').write(self.runbzr('diff', retcode=1, backtick=1))
46
58
        self.runbzr('revert')
47
59
        assert file('myfile', 'rb').read() == 'hello'
48
 
        self.runbzr('patch mypatch')
 
60
        self.runbzr('patch --silent mypatch')
49
61
        assert file('myfile', 'rb').read() == 'goodbye'
50
62
 
51
63
    def test_branch_history(self):
116
128
        self.runbzr('commit -m hello')
117
129
        self.runbzr('export ../source-0.1.tar.gz')
118
130
        self.runbzr('export ../source-0.1.tar.bz2')
 
131
        self.runbzr('export ../source-0.1')
119
132
        self.runbzr('init ../import')
120
133
        os.chdir('../import')
121
134
        self.runbzr('import ../source-0.1.tar.gz')
132
145
        self.failUnlessExists('import3/src/myfile')
133
146
        self.runbzr('import source-0.1.tar.bz2 import4')
134
147
        self.failUnlessExists('import4/src/myfile')
135
 
 
136
 
    def test_shove(self):
137
 
        self.runbzr('init source')
138
 
        f = file('source/file', 'wb')
139
 
        f.write('hello\n')
140
 
        f.close()
141
 
        self.runbzr('add source/file')
142
 
        self.runbzr('commit source -m foo')
143
 
        self.runbzr('branch source target1')
144
 
        self.runbzr('branch source target2')
145
 
        f = file('source/file', 'wb')
146
 
        f.write('goodbye\n')
147
 
        f.close()
148
 
        self.runbzr('shove target1 source')
149
 
        f = file('target1/file', 'rb')
150
 
        self.assertEqual(f.read(), 'goodbye\n')
151
 
        f.close()
152
 
        os.chdir('source')
153
 
        self.runbzr('shove target2', retcode=3)
154
 
        self.runbzr('shove ../target2')
155
 
        f = file('../target2/file', 'rb')
156
 
        self.assertEqual(f.read(), 'goodbye\n')
157
 
        f.close()
 
148
        self.runbzr('import source-0.1 import5')
 
149
        self.failUnlessExists('import5/src/myfile')
158
150
 
159
151
def test_suite():
160
152
    return makeSuite(TestBzrTools)