Skip to content

Commit 675c8a6

Browse files
committed
Merge branch 'main' into 101-check-vulnerabilities
2 parents 1f0a8aa + 3546dfd commit 675c8a6

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

scanpipe/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ def clear_tmp_directory(self):
649649
pipeline Run.
650650
"""
651651
shutil.rmtree(self.tmp_path, ignore_errors=True)
652-
self.tmp_path.mkdir(exist_ok=True)
652+
self.tmp_path.mkdir(parents=True, exist_ok=True)
653653

654654
@property
655655
def input_sources_list(self):

scanpipe/tests/test_models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ def test_scanpipe_project_model_clear_tmp_directory(self):
113113
self.assertTrue(self.project1.tmp_path.exists())
114114
self.assertEqual([], list(self.project1.tmp_path.glob("*")))
115115

116+
self.assertTrue(self.project1.tmp_path.exists())
117+
shutil.rmtree(self.project1.work_path, ignore_errors=True)
118+
self.assertFalse(self.project1.tmp_path.exists())
119+
self.project1.clear_tmp_directory()
120+
self.assertTrue(self.project1.tmp_path.exists())
121+
116122
def test_scanpipe_project_model_archive(self):
117123
(self.project1.input_path / "input_file").touch()
118124
(self.project1.codebase_path / "codebase_file").touch()

scanpipe/tests/test_views.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,25 +77,16 @@ def test_scanpipe_views_project_list_filters(self):
7777
"""
7878
self.assertContains(response, is_archived_filters, html=True)
7979

80-
pipeline_filters = """
81-
<li><a href="?pipeline=" class="dropdown-item is-active">All</a></li>
82-
<li><a href="?pipeline=docker" class="dropdown-item">docker</a></li>
83-
<li>
84-
<a href="?pipeline=docker_windows" class="dropdown-item">docker_windows</a>
85-
</li>
86-
<li>
87-
<a href="?pipeline=load_inventory" class="dropdown-item">load_inventory</a>
88-
</li>
89-
<li>
90-
<a href="?pipeline=root_filesystems" class="dropdown-item">
91-
root_filesystems
92-
</a>
93-
</li>
94-
<li>
95-
<a href="?pipeline=scan_codebase" class="dropdown-item">scan_codebase</a></li>
96-
<li><a href="?pipeline=scan_package" class="dropdown-item">scan_package</a></li>
97-
"""
98-
self.assertContains(response, pipeline_filters, html=True)
80+
pipeline_filters = [
81+
"?pipeline=docker",
82+
"?pipeline=docker_windows",
83+
"?pipeline=load_inventory",
84+
"?pipeline=root_filesystems",
85+
"?pipeline=scan_codebase",
86+
"?pipeline=scan_package",
87+
]
88+
for pipeline_filter in pipeline_filters:
89+
self.assertContains(response, pipeline_filter)
9990

10091
status_filters = """
10192
<li><a href="?status=" class="dropdown-item is-active">All</a></li>

0 commit comments

Comments
 (0)