Пример #1
0
 def test_string_filename(self):
     reader = TextReader(self.csv1, header=None)
     result = reader.read()
Пример #2
0
 def _test(text, **kwargs):
     nice_text = text.replace('\r', '\r\n')
     result = TextReader(StringIO(text), **kwargs).read()
     expected = TextReader(StringIO(nice_text), **kwargs).read()
     assert_array_dicts_equal(result, expected)
Пример #3
0
 def _make_reader(**kwds):
     return TextReader(StringIO(data), delimiter=',', **kwds)
Пример #4
0
 def test_string_factorize(self):
     # should this be optional?
     data = 'a\nb\na\nb\na'
     reader = TextReader(StringIO(data), header=None)
     result = reader.read()
     self.assertEqual(len(set(map(id, result[0]))), 2)
Пример #5
0
 def test_StringIO(self):
     with open(self.csv1, 'rb') as f:
         text = f.read()
     src = BytesIO(text)
     reader = TextReader(src, header=None)
     reader.read()
Пример #6
0
 def test_StringIO(self):
     text = open(self.csv1, 'rb').read()
     src = BytesIO(text)
     reader = TextReader(src, header=None)
     result = reader.read()