~ubuntu-branches/debian/sid/bzr/sid-201310300331

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_too_much.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-06-01 13:17:25 UTC
  • mfrom: (1.5.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20110601131725-4iq8sukc1c0ynclw
Tags: 2.4.0~beta3-2
Add 04_fix_undecodable_argv; cope with $HOME not existing on some
buildd machines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    def test_revert(self):
61
61
        self.run_bzr('init')
62
62
 
63
 
        file('hello', 'wt').write('foo')
 
63
        with file('hello', 'wt') as f: f.write('foo')
64
64
        self.run_bzr('add hello')
65
65
        self.run_bzr('commit -m setup hello')
66
66
 
67
 
        file('goodbye', 'wt').write('baz')
 
67
        with file('goodbye', 'wt') as f: f.write('baz')
68
68
        self.run_bzr('add goodbye')
69
69
        self.run_bzr('commit -m setup goodbye')
70
70
 
71
 
        file('hello', 'wt').write('bar')
72
 
        file('goodbye', 'wt').write('qux')
 
71
        with file('hello', 'wt') as f: f.write('bar')
 
72
        with file('goodbye', 'wt') as f: f.write('qux')
73
73
        self.run_bzr('revert hello')
74
74
        self.check_file_contents('hello', 'foo')
75
75
        self.check_file_contents('goodbye', 'qux')
97
97
        else:
98
98
            self.log("skipping revert symlink tests")
99
99
 
100
 
        file('hello', 'wt').write('xyz')
 
100
        with file('hello', 'wt') as f: f.write('xyz')
101
101
        self.run_bzr('commit -m xyz hello')
102
102
        self.run_bzr('revert -r 1 hello')
103
103
        self.check_file_contents('hello', 'foo')
109
109
 
110
110
    def example_branch(test):
111
111
        test.run_bzr('init')
112
 
        file('hello', 'wt').write('foo')
 
112
        with file('hello', 'wt') as f: f.write('foo')
113
113
        test.run_bzr('add hello')
114
114
        test.run_bzr('commit -m setup hello')
115
 
        file('goodbye', 'wt').write('baz')
 
115
        with file('goodbye', 'wt') as f: f.write('baz')
116
116
        test.run_bzr('add goodbye')
117
117
        test.run_bzr('commit -m setup goodbye')
118
118
 
127
127
        os.chdir('..')
128
128
        self.run_bzr('branch a b')
129
129
        os.chdir('b')
130
 
        open('b', 'wb').write('else\n')
 
130
        with open('b', 'wb') as f: f.write('else\n')
131
131
        self.run_bzr('add b')
132
132
        self.run_bzr(['commit', '-m', 'added b'])
133
133
 
195
195
        """Create a conflicted tree"""
196
196
        os.mkdir('base')
197
197
        os.chdir('base')
198
 
        file('hello', 'wb').write("hi world")
199
 
        file('answer', 'wb').write("42")
 
198
        with file('hello', 'wb') as f: f.write("hi world")
 
199
        with file('answer', 'wb') as f: f.write("42")
200
200
        self.run_bzr('init')
201
201
        self.run_bzr('add')
202
202
        self.run_bzr('commit -m base')
203
203
        self.run_bzr('branch . ../other')
204
204
        self.run_bzr('branch . ../this')
205
205
        os.chdir('../other')
206
 
        file('hello', 'wb').write("Hello.")
207
 
        file('answer', 'wb').write("Is anyone there?")
 
206
        with file('hello', 'wb') as f: f.write("Hello.")
 
207
        with file('answer', 'wb') as f: f.write("Is anyone there?")
208
208
        self.run_bzr('commit -m other')
209
209
        os.chdir('../this')
210
 
        file('hello', 'wb').write("Hello, world")
 
210
        with file('hello', 'wb') as f: f.write("Hello, world")
211
211
        self.run_bzr('mv answer question')
212
 
        file('question', 'wb').write("What do you get when you multiply six"
 
212
        with file('question', 'wb') as f: f.write("What do you get when you multiply six"
213
213
                                   "times nine?")
214
214
        self.run_bzr('commit -m this')
215
215
 
438
438
 
439
439
        progress("file with spaces in name")
440
440
        mkdir('sub directory')
441
 
        file('sub directory/file with spaces ', 'wt').write('see how this works\n')
 
441
        with file('sub directory/file with spaces ', 'wt') as f: f.write('see how this works\n')
442
442
        self.run_bzr('add .')
443
443
        self.run_bzr('diff', retcode=1)
444
444
        self.run_bzr('commit -m add-spaces')
590
590
        os.mkdir('my-branch')
591
591
        os.chdir('my-branch')
592
592
        self.run_bzr('init')
593
 
        file('hello', 'wt').write('foo')
 
593
        with file('hello', 'wt') as f: f.write('foo')
594
594
        self.run_bzr('add hello')
595
595
        self.run_bzr('commit -m setup')
596
596