Skip to content

Commit b2a3f97

Browse files
committed
TST: Move and change the test case
1 parent bacf224 commit b2a3f97

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

pandas/tests/io/parser/common.py

-10
Original file line numberDiff line numberDiff line change
@@ -750,16 +750,6 @@ def test_utf16_example(self):
750750
result = self.read_table(buf, encoding='utf-16')
751751
assert len(result) == 50
752752

753-
def test_compressed_utf16_example(self):
754-
# GH18071
755-
path = tm.get_data_path('utf16_ex.zip')
756-
expected_path = tm.get_data_path('utf16_ex.txt')
757-
758-
result = self.read_table(path, encoding='utf-16', compression='zip')
759-
expected = self.read_table(expected_path, encoding='utf-16')
760-
761-
tm.assert_frame_equal(result, expected)
762-
763753
def test_unicode_encoding(self):
764754
pth = tm.get_data_path('unicode_series.csv')
765755

pandas/tests/io/parser/compression.py

+14
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import pytest
99

10+
import pandas as pd
1011
import pandas.util.testing as tm
1112

1213

@@ -157,6 +158,19 @@ def test_read_csv_infer_compression(self):
157158

158159
inputs[3].close()
159160

161+
def test_read_csv_compressed_utf16_example(self):
162+
# GH18071
163+
path = tm.get_data_path('utf16_ex_small.zip')
164+
165+
result = self.read_csv(path, encoding='utf-16',
166+
compression='zip', sep='\t')
167+
expected = pd.DataFrame({
168+
u'Country': [u'Venezuela', u'Venezuela'],
169+
u'Twitter': [u'Hugo Chávez Frías', u'Henrique Capriles R.']
170+
})
171+
172+
tm.assert_frame_equal(result, expected)
173+
160174
def test_invalid_compression(self):
161175
msg = 'Unrecognized compression type: sfark'
162176
with tm.assert_raises_regex(ValueError, msg):
-1.64 KB
Binary file not shown.
285 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)