Skip to content

Commit f4dd486

Browse files
committed
adjusted Update view
1 parent 402a1af commit f4dd486

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

api_app/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,4 +922,8 @@ def pull(self, request, name=None):
922922
{"detail": "Unexpected exception raised. Check the code."}
923923
)
924924
else:
925+
if update_status is None:
926+
raise ValidationError(
927+
{"detail": "This Plugin has no Update implemented"}
928+
)
925929
return Response(data={"status": update_status}, status=status.HTTP_200_OK)

tests/api_app/analyzers_manager/test_views.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ def test_pull(self):
4040
self.assertIn("status", result)
4141
self.assertTrue(result["status"])
4242

43-
analyzer = "QuarkEngine"
43+
analyzer = "Doc_Info"
4444
response = self.client.post(f"{self.URL}/{analyzer}/pull")
4545
self.assertEqual(response.status_code, 400)
4646
result = response.json()
47+
print(result)
4748
self.assertIn("errors", result)
4849
self.assertIn("detail", result["errors"])
49-
self.assertEqual(result["errors"]["detail"], "No update implemented")
50+
self.assertEqual(
51+
result["errors"]["detail"], "This Plugin has no Update implemented"
52+
)
5053

5154
def test_health_check(self):
5255
analyzer = "ClamAV"

0 commit comments

Comments
 (0)