Esempio n. 1
0
 def load(self):
     '''Load the test file, yaml parse it, extract file-level metadata'''
     with open(self.full_path, encoding='utf-8') as f:
         parsed_yaml = parsePolyglot.parseYAML(f)
     self.description = parsed_yaml.get('desc', 'No description')
     self.table_var_names = self.get_varnames(parsed_yaml)
     self.reql_vars.update(self.table_var_names)
     self.raw_test_data = parsed_yaml['tests']
     self.test_generator = process_polyglot.tests_and_defs(
         self.filename,
         self.raw_test_data,
         context=process_polyglot.create_context(r, self.table_var_names),
         custom_field='java',
     )
     return self
Esempio n. 2
0
 def load(self):
     '''Load the test file, yaml parse it, extract file-level metadata'''
     with open(self.full_path, encoding='utf-8') as f:
         parsed_yaml = parsePolyglot.parseYAML(f)
     self.description = parsed_yaml.get('desc', 'No description')
     self.table_var_names = self.get_varnames(parsed_yaml)
     self.reql_vars.update(self.table_var_names)
     self.raw_test_data = parsed_yaml['tests']
     self.test_generator = process_polyglot.tests_and_defs(
         self.filename,
         self.raw_test_data,
         context=process_polyglot.create_context(r, self.table_var_names),
         custom_field='java',
     )
     return self
Esempio n. 3
0
 def load(self):
     context_r = r
     # rethinkdb python package does not put ast on RethinkDB object anymore
     # but the test conversion using it. This is a "not so nice" mitigation of
     # the issue until we figure out how to do this better.
     r.ast = rethinkdb_ast
     """Load the test file, yaml parse it, extract file-level metadata"""
     with open(self.full_path, encoding="utf-8") as f:
         parsed_yaml = parse_polyglot.parseYAML(f)
     self.description = parsed_yaml.get("desc", "No description")
     self.table_var_names = self.get_varnames(parsed_yaml)
     self.reql_vars.update(self.table_var_names)
     self.raw_test_data = parsed_yaml["tests"]
     self.test_generator = process_polyglot.tests_and_defs(
         self.filename,
         self.raw_test_data,
         context=process_polyglot.create_context(r, self.table_var_names),
         custom_field="java",
     )
     return self