~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shelf_tests.py

  • Committer: Aaron Bentley
  • Date: 2006-03-07 15:21:50 UTC
  • mto: (147.1.69 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 323.
  • Revision ID: abentley@panoramicfeedback.com-20060307152150-f0e4f0174eb6d241
Applied Robert's random fixes as non-merges

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
 
 
3
import os
 
4
 
3
5
import bzrlib.tests
4
 
import os
 
6
 
 
7
 
5
8
class ShelfTests(bzrlib.tests.TestCaseInTempDir):
6
9
    ORIGINAL = '\n\nhello test world\n\n'
7
10
    MODIFIED = '\n\ngoodbye test world\n\n'
37
40
        file('test_file', 'w').write(self.MODIFIED)
38
41
 
39
42
        # Check the diff is right
40
 
        self.assertEqual(self.capture('diff', retcode=1),
 
43
        self.assertEqualDiff(self.capture('diff', retcode=1),
41
44
            self.DIFF_HEADER + self.DIFF_1 + '\n')
42
45
 
43
46
        # Shelve the changes
47
50
        self.assertEqual(self.capture('diff'), '')
48
51
 
49
52
        # Make sure the file is actually back the way it was
50
 
        self.assertEqual(file('test_file').read(), self.ORIGINAL)
 
53
        self.assertEqualDiff(file('test_file').read(), self.ORIGINAL)
51
54
 
52
55
        # Check the shelf is right
53
56
        shelf = file('.bzr-shelf').read()
113
116
        tree = BzrDir.create_standalone_workingtree('.')
114
117
 
115
118
        cmd = 'shelve -r 1..2'
116
 
        (stdout, stderr) = self.run_bzr_captured(cmd.split(), retcode=None)
 
119
        (stdout, stderr) = self.run_bzr_captured(cmd.split(), retcode=3)
117
120
 
118
121
        self.assertEqual(stderr.split('\n')[0],
119
122
            'bzr: ERROR: shelve only accepts a single revision parameter.')