##// END OF EJS Templates
Merge pull request #1709 from jstenar/arg_split_fix...
Merge pull request #1709 from jstenar/arg_split_fix fixes #1708, failing test in arg_split on windows There were a conflicting defintion of CommandLineToArgvW.res_type in _process_win32 and _process_win32_controller. This PR fixes the issue.

File last commit:

r6563:10f133e4
r6821:b9c986f5 merge
Show More
test_openpy.py
23 lines | 803 B | text/x-python | PythonLexer
Thomas Kluyver
Add tests for IPython.utils.openpy
r6452 import io
import os.path
import nose.tools as nt
from IPython.utils import openpy
mydir = os.path.dirname(__file__)
nonascii_path = os.path.join(mydir, '../../core/tests/nonascii.py')
def test_detect_encoding():
f = open(nonascii_path, 'rb')
enc, lines = openpy.detect_encoding(f.readline)
nt.assert_equal(enc, 'iso-8859-5')
def test_read_file():
read_specified_enc = io.open(nonascii_path, encoding='iso-8859-5').read()
read_detected_enc = openpy.read_py_file(nonascii_path, skip_encoding_cookie=False)
nt.assert_equal(read_detected_enc, read_specified_enc)
Fernando Perez
Quick, trivial fix to test failure introduced in cca0bf (PR #1624)
r6563 assert u'coding: iso-8859-5' in read_detected_enc
Thomas Kluyver
Add tests for IPython.utils.openpy
r6452
read_strip_enc_cookie = openpy.read_py_file(nonascii_path, skip_encoding_cookie=True)
Fernando Perez
Quick, trivial fix to test failure introduced in cca0bf (PR #1624)
r6563 assert u'coding: iso-8859-5' not in read_strip_enc_cookie
Thomas Kluyver
Add tests for IPython.utils.openpy
r6452