def test_get_data_from_empty_file(self): with tempfile.NamedTemporaryFile() as source: source.write(b'') source.seek(0) self.assertEqual([], list(cli.get_data(source.name)))
def test_get_data(self): with tempfile.NamedTemporaryFile() as source: source.write(b'1, web, 34.33\n') source.seek(0) self.assertEqual([['1', 'web', '34.33']], list(cli.get_data(source.name)))