def test_encoding_on_second_line(self): script_text = '''#!/usr/bin/env python # -*- coding: utf-8 -*- print 1 ''' header_text_with_encoding = preprocessor._add_encoding_to_header(self.header_text, script_text) self.assertEqual(header_text_with_encoding, self.header_text_with_encoding)
def test_encoding_on_first_line(self): script_text = '''# -*- coding: utf-8 -*- print 1 ''' header_text_with_encoding = preprocessor._add_encoding_to_header( self.header_text, script_text) self.assertEqual(header_text_with_encoding, self.header_text_with_encoding)
def test_encoding_on_third_line(self): script_text = '''#!/usr/bin/env python # some comment # -*- coding: utf-8 -*- print 1 ''' header_text_with_encoding = preprocessor._add_encoding_to_header( self.header_text, script_text) self.assertEqual(header_text_with_encoding, self.header_text)
def test_no_encoding(self): script_text = '''print 1 ''' header_text_with_encoding = preprocessor._add_encoding_to_header( self.header_text, script_text) self.assertEqual(header_text_with_encoding, self.header_text)
def test_encoding_on_first_line(self): script_text = '''# -*- coding: utf-8 -*- print 1 ''' header_text_with_encoding = preprocessor._add_encoding_to_header(self.header_text, script_text) self.assertEqual(header_text_with_encoding, self.header_text_with_encoding)
def test_no_encoding(self): script_text = '''print 1 ''' header_text_with_encoding = preprocessor._add_encoding_to_header(self.header_text, script_text) self.assertEqual(header_text_with_encoding, self.header_text)