/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_msgeditor.py

  • Committer: Alexander Belchenko
  • Date: 2007-04-30 19:52:44 UTC
  • mto: This revision was merged to the branch mainline in revision 2478.
  • Revision ID: bialix@ukr.net-20070430195244-pxc5r3x72ckh027e
Bugfix #110901: commit message template written with native line-endings; corresponding unit tests added

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
                del os.environ['EDITOR']
188
188
            else:
189
189
                os.environ['EDITOR'] = editor
 
190
 
 
191
    def test__create_temp_file_with_commit_template(self):
 
192
        # check that commit template written properly
 
193
        # and has platform native line-endings (CRLF on win32)
 
194
        msgfilename, hasinfo = bzrlib.\
 
195
                               msgeditor.\
 
196
                               _create_temp_file_with_commit_template(
 
197
                                    'infotext', '----', 'start message')
 
198
        self.assertNotEqual(None, msgfilename)
 
199
        self.assertTrue(hasinfo)
 
200
        expected = os.linesep.join(['start message','','',
 
201
                                    '----','','infotext'])
 
202
        self.assertFileEqual(expected, msgfilename)
 
203
 
 
204
    def test__create_temp_file_with_empty_commit_template(self):
 
205
        # empty file
 
206
        msgfilename, hasinfo = bzrlib.\
 
207
                               msgeditor.\
 
208
                               _create_temp_file_with_commit_template('')
 
209
        self.assertNotEqual(None, msgfilename)
 
210
        self.assertFalse(hasinfo)
 
211
        self.assertFileEqual('', msgfilename)