~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/shelf_tests.py

  • Committer: Aaron Bentley
  • Date: 2006-07-11 18:53:52 UTC
  • mfrom: (0.3.5 my_shelf)
  • Revision ID: abentley@panoramicfeedback.com-20060711185352-562216f86dac6f7f
Merge shelf colorizing

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
            count -= 1
68
68
 
69
69
            # Modify the test file
70
 
            file('test_file', 'w').write(self.MODIFIED)
 
70
            # write in binary mode because on win32 line-endings should be LF
 
71
            f = file('test_file', 'wb')
 
72
            f.write(self.MODIFIED)
 
73
            f.close()
71
74
 
72
75
            self._check_diff()
73
76
            
109
112
            self.fail("Shelf exists, but it shouldn't")
110
113
 
111
114
    def __create_and_add_test_file(self, filename='test_file'):
112
 
        f = open(filename, 'w')
 
115
        # write in binary mode because on win32 line-endings should be LF
 
116
        f = open(filename, 'wb')
113
117
        f.write(self.ORIGINAL)
114
118
        f.close()
115
119
        self.tree.add(self.tree.relpath(os.path.join(os.getcwd(), filename)))
302
306
        self.__create_and_add_test_file(filename='test_file2')
303
307
 
304
308
        # Modify the test files
305
 
        file('test_file', 'w').write(self.MODIFIED)
306
 
        file('test_file2', 'w').write(self.MODIFIED)
 
309
        # write in binary mode because on win32 line-endings should be LF
 
310
        f = file('test_file', 'wb')
 
311
        f.write(self.MODIFIED)
 
312
        f.close()
 
313
        f = file('test_file2', 'wb')
 
314
        f.write(self.MODIFIED)
 
315
        f.close()
307
316
        new_date = _patch_header_date(self.tree, 
308
317
            self.tree.inventory.path2id('test_file'), 'test_file')
309
318
 
429
438
        self.__create_and_add_test_file()
430
439
 
431
440
        # Modify the test file
432
 
        file('test_file', 'w').write(self.MODIFIED)
 
441
        # write in binary mode because on win32 line-endings should be LF
 
442
        f = file('test_file', 'wb')
 
443
        f.write(self.MODIFIED)
 
444
        f.close()
433
445
 
434
446
        # Shelve the changes
435
447
        self.run_bzr('shelve', '--all', retcode=0)