예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
    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)
예제 #6
0
    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)