def _methods(self): json_path = os.path.join(_TEST_DIR, 'edge_cases/polyglot_snippet_data.json') methods, test_method_map = analyze._get_data(json_path) analyze._store_tests_on_methods(methods, test_method_map) self.method = methods[0]
def _flask_map(self): root_path = os.path.join(_TEST_DIR, 'flask') json_path = os.path.join(_TEST_DIR, 'flask/polyglot_snippet_data.json') self.flask_test_path = os.path.join(root_path, 'flask_test.py') self.flask_methods, test_map = analyze._get_data(json_path) analyze._store_tests_on_methods(self.flask_methods, test_map)
def _webapp2_map(self): root_path = os.path.join(_TEST_DIR, 'webapp2') json_path = os.path.join(_TEST_DIR, 'webapp2/polyglot_snippet_data.json') self.webapp2_test_path = os.path.join(root_path, 'webapp2_test.py') self.webapp2_methods, test_map = analyze._get_data(json_path) analyze._store_tests_on_methods(self.webapp2_methods, test_map)
def test_labels_ignored_tags(self): json_path = os.path.join(_TEST_DIR, 'edge_cases/polyglot_snippet_data.json') tuple_methods, _ = analyze._get_data(json_path) _, ignored_tags = analyze._process_file_region_tags( os.path.join(_TEST_DIR, 'flask/flask_main.py'), json_path, tuple_methods) assert 'app' in ignored_tags
def _direct_invocation_map(self): root_path = os.path.join(_TEST_DIR, 'edge_cases') json_path = os.path.join(_TEST_DIR, 'edge_cases/polyglot_snippet_data.json') self.direct_invocation_test_path = (os.path.join( root_path, 'edge_cases_test.py')) self.direct_invocation_methods, test_map = ( analyze._get_data(json_path)) analyze._store_tests_on_methods(self.direct_invocation_methods, test_map)