MCPcopy Index your code
hub / github.com/wireservice/csvkit / test_stdin

Method test_stdin

tests/test_utilities/test_csvsql.py:166–180  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164 ''')) # noqa: W291
165
166 def test_stdin(self):
167 input_file = io.BytesIO(b'a,b,c\n4,2,3\n')
168
169 with stdin_as_string(input_file):
170 sql = self.get_output(['--tables', 'foo'])
171
172 self.assertEqual(sql.replace('\t', ' '), dedent('''\
173 CREATE TABLE foo (
174 a DECIMAL NOT NULL,
175 b DECIMAL NOT NULL,
176 c DECIMAL NOT NULL
177 );
178 ''')) # noqa: W291
179
180 input_file.close()
181
182 def test_stdin_and_filename(self):
183 input_file = io.BytesIO(b'a,b,c\n1,2,3\n')

Callers

nothing calls this directly

Calls 3

stdin_as_stringFunction · 0.90
get_outputMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected