Skip to content

Commit d202fd0

Browse files
Ajay SaxenaAjay Saxena
Ajay Saxena
authored and
Ajay Saxena
committed
added test for valid encoding, modified setup.py so that pandas/util/clipboard can be found
1 parent dd57ae3 commit d202fd0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

pandas/io/tests/test_clipboard.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,17 @@ def test_invalid_encoding(self):
123123
with tm.assertRaises(ValueError):
124124
data.to_clipboard(encoding='ascii')
125125
with tm.assertRaises(NotImplementedError):
126-
pd.read_clipboard(encoding='ascii')
126+
pd.read_clipboard(encoding='ascii')
127+
128+
def test_round_trip_valid_encodings(self):
129+
for enc in ['UTF-8','utf-8','utf8']:
130+
for dt in self.data_types:
131+
data = self.data[dt]
132+
data.to_clipboard(encoding=enc)
133+
result = read_clipboard()
134+
tm.assert_frame_equal(data, result, check_dtype=False)
135+
136+
127137

128138

129139

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,8 @@ def pxd(name):
642642
'pandas.io.tests.parser',
643643
'pandas.io.tests.sas',
644644
'pandas.stats.tests',
645-
'pandas.msgpack'
645+
'pandas.msgpack',
646+
'pandas.util.clipboard'
646647
],
647648
package_data={'pandas.io': ['tests/data/legacy_hdf/*.h5',
648649
'tests/data/legacy_pickle/*/*.pickle',

0 commit comments

Comments
 (0)