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

Function test_sqlite_scan_output

tests/test_outputs.py:112–140  ·  view source on GitHub ↗
(fixtures, tmp_path: Path)

Source from the content-addressed store, hash-verified

110
111
112def test_sqlite_scan_output(fixtures, tmp_path: Path):
113 scan_path = str(fixtures.path("flask_app.py"))
114 db_path = tmp_path / "aura_test_output.sqlite"
115 _ = fixtures.get_cli_output(
116 ['scan', scan_path, '--format', f'sqlite://{db_path}']
117 )
118 db = sqlite3.connect(db_path)
119 db.row_factory = sqlite3.Row
120
121 inputs = [dict(x) for x in db.execute(
122 "SELECT * FROM inputs WHERE input=?",
123 (scan_path,)
124 ).fetchall()]
125 assert len(inputs) == 1
126
127 input_id = inputs[0]["id"]
128
129 locations = [dict(x) for x in db.execute("SELECT * FROM locations").fetchall()]
130
131 assert len(locations) == 1
132 for loc in locations:
133 assert loc["input"] == input_id
134
135 loc_id = locations[0]["id"]
136
137 detections = [dict(x) for x in db.execute("SELECT * FROM detections").fetchall()]
138 assert len(detections) > 3
139 for d in detections:
140 assert d["location"] == loc_id
141
142
143def test_non_existing(fixtures):

Callers

nothing calls this directly

Calls 2

pathMethod · 0.80
get_cli_outputMethod · 0.80

Tested by

no test coverage detected