From 1f510d8e2b80ebe1709bd977d0ea6eda57063bf5 Mon Sep 17 00:00:00 2001 From: Federico Fantini Date: Wed, 25 Sep 2024 13:01:17 +0200 Subject: [PATCH] deepsource --- api_app/mixins.py | 4 +--- tests/api_app/test_mixins.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/api_app/mixins.py b/api_app/mixins.py index 111ded361..6cbbbe9f6 100644 --- a/api_app/mixins.py +++ b/api_app/mixins.py @@ -267,9 +267,7 @@ def _vt_intelligence_search( ) -> Dict: logger.info(f"Running VirusTotal intelligence search query: {query}") - if limit > 300: - limit = 300 # this is a limit forced by VT service - + limit = min(limit, 300) # this is a limit forced by VT service params = { "query": query, "limit": limit, diff --git a/tests/api_app/test_mixins.py b/tests/api_app/test_mixins.py index ac8f9cb35..efec382b5 100644 --- a/tests/api_app/test_mixins.py +++ b/tests/api_app/test_mixins.py @@ -1,5 +1,6 @@ # This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl # See the file 'LICENSE' for copying permission. +import pathlib from pathlib import PosixPath from api_app.analyzers_manager.constants import ObservableTypes @@ -11,7 +12,12 @@ class VirusTotalv3Base(VirusTotalv3BaseMixin): @classmethod + @property def python_base_path(cls) -> PosixPath: + return pathlib.PosixPath(r"/") + + @classmethod + def update(cls) -> bool: pass def run(self) -> dict: @@ -20,7 +26,12 @@ def run(self) -> dict: class VirusTotalv3Analyzer(VirusTotalv3AnalyzerMixin): @classmethod + @property def python_base_path(cls) -> PosixPath: + return pathlib.PosixPath(r"/") + + @classmethod + def update(cls) -> bool: pass def run(self) -> dict: