def check(expr, data, expected): """Check a test scenario.""" with open(self.data_filename, 'w') as data_file: data_file.write(data) bigquery.do_jq( expr, self.data_filename, self.out_filename, jq_bin=ARGS.jq, ) with open(self.out_filename) as out_file: actual = out_file.read().replace(' ', '').replace('\n', '') self.assertEqual(actual, expected)