File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,20 @@ async def test_update_ecosystems_mocked():
17
17
18
18
await osv .update_ecosystems ()
19
19
20
- assert osv .ecosystems == ["ecosystem1" ]
20
+ assert osv .ecosystems == ["ecosystem1" ]
21
+
22
+ @pytest .mark .asyncio
23
+ @patch ("cve_bin_tool.data_sources.osv_source.aio_run_command" , new_callable = AsyncMock )
24
+ async def test_update_ecosystems (mock_aio_run_command ):
25
+ # Mock gsutil output: two folders, one of them contains all.zip
26
+ mock_aio_run_command .side_effect = [
27
+ b"https://osv-vulnerabilities/python/\n https://osv-vulnerabilities/rust/\n " ,
28
+ b"https://osv-vulnerabilities/python/all.zip\n " ,
29
+ b"" , # rust does not contain all.zip
30
+ ]
31
+
32
+ osv = OSV_Source ()
33
+ await osv .update_ecosystems ()
34
+
35
+ assert "python" in osv .ecosystems
36
+ assert "rust" not in osv .ecosystems
You can’t perform that action at this time.
0 commit comments