MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / scan_test_file

Method scan_test_file

tests/conftest.py:80–102  ·  view source on GitHub ↗
(self, name, decode=True, args=None)

Source from the content-addressed store, hash-verified

78 return fp.read()
79
80 def scan_test_file(self, name, decode=True, args=None):
81 if name.startswith("mirror://"):
82 pth = name
83 else:
84 pth = os.fspath(self.path(name))
85
86 cmd = ["scan", pth]
87
88 if args:
89 cmd += args
90
91 if ("--format" not in cmd) and ("-f" not in cmd):
92 cmd += ["--format", "json"]
93
94 result = self.get_cli_output(cmd)
95 if decode:
96 try:
97 return json.loads(result.output)
98 except Exception:
99 print(result.output, file=sys.stdout)
100 raise
101 else:
102 return result
103
104 def get_cli_output(self, args, check_exit_code=True) -> Result:
105 global cli

Callers 14

scan_and_matchMethod · 0.95
test_secret_finderFunction · 0.80
test_simple_cli_analysisFunction · 0.80
test_tag_filteringFunction · 0.80
test_async_cleanupFunction · 0.80
test_zip_extractorFunction · 0.80
test_generic_sqliFunction · 0.80
test_sarif_output_e2eFunction · 0.80

Calls 2

pathMethod · 0.95
get_cli_outputMethod · 0.95

Tested by

no test coverage detected