diff --git a/tcex/api/tc/v3/_gen/_gen_abc.py b/tcex/api/tc/v3/_gen/_gen_abc.py index 7749893d6..a1bf80ab5 100644 --- a/tcex/api/tc/v3/_gen/_gen_abc.py +++ b/tcex/api/tc/v3/_gen/_gen_abc.py @@ -488,12 +488,7 @@ def tap(self, type_: str): ]: return 'tcex.api.tc.v3.security' - if type_.plural().lower() in [ - 'categories', - 'results', - 'subtypes', - 'keyword_sections' - ]: + if type_.plural().lower() in ['categories', 'results', 'subtypes', 'keyword_sections']: return 'tcex.api.tc.v3.intel_requirements' return 'tcex.api.tc.v3' diff --git a/tcex/api/tc/v3/_gen/_gen_object_abc.py b/tcex/api/tc/v3/_gen/_gen_object_abc.py index 401a86347..161727f9b 100644 --- a/tcex/api/tc/v3/_gen/_gen_object_abc.py +++ b/tcex/api/tc/v3/_gen/_gen_object_abc.py @@ -445,7 +445,9 @@ def as_entity(self) -> dict: ) return '\n'.join(as_entity_property_method) - def _gen_code_object_replace_type_method(self, type_: str, model_type: str | None = None) -> str: + def _gen_code_object_replace_type_method( + self, type_: str, model_type: str | None = None + ) -> str: """Return the method code. def replace_artifact(self, **kwargs): diff --git a/tcex/api/tc/v3/intel_requirements/intel_requirement.py b/tcex/api/tc/v3/intel_requirements/intel_requirement.py index 576c7e225..4b2e5e0fe 100644 --- a/tcex/api/tc/v3/intel_requirements/intel_requirement.py +++ b/tcex/api/tc/v3/intel_requirements/intel_requirement.py @@ -182,9 +182,8 @@ def replace_keyword_section(self, data: dict | list | ObjectABC | KeywordSection if not isinstance(data, list): data = [data] - if ( - isinstance(data, list) and - all(isinstance(item, (ObjectABC, KeywordSectionModel)) for item in data) + if isinstance(data, list) and all( + isinstance(item, (ObjectABC, KeywordSectionModel)) for item in data ): transformed_data = data elif isinstance(data, list) and all(isinstance(item, dict) for item in data): @@ -192,7 +191,7 @@ def replace_keyword_section(self, data: dict | list | ObjectABC | KeywordSection elif isinstance(data, dict): transformed_data = KeywordSectionModel(**data) else: - raise ValueError("Invalid data to replace_keyword_section") + raise ValueError('Invalid data to replace_keyword_section') if isinstance(transformed_data, list): for item in transformed_data: diff --git a/tcex/api/tc/v3/v3_model_abc.py b/tcex/api/tc/v3/v3_model_abc.py index a1c088467..92188f1dd 100644 --- a/tcex/api/tc/v3/v3_model_abc.py +++ b/tcex/api/tc/v3/v3_model_abc.py @@ -55,9 +55,10 @@ def __init__(self, **kwargs): # this rule. # pylint: disable=no-member if ( - kwargs and hasattr(self, 'id') and - self.id is None and - self.__config__.title != 'Keyword Section Model' + kwargs + and hasattr(self, 'id') + and self.id is None + and self.__config__.title != 'Keyword Section Model' ): self._staged = True diff --git a/tests/api/tc/v3/intel_requirements/test_intel_requirements_interface.py b/tests/api/tc/v3/intel_requirements/test_intel_requirements_interface.py index 34b808e07..c32ac17c2 100644 --- a/tests/api/tc/v3/intel_requirements/test_intel_requirements_interface.py +++ b/tests/api/tc/v3/intel_requirements/test_intel_requirements_interface.py @@ -5,9 +5,10 @@ # third-party import pytest -from tcex.api.tc.v3.intel_requirements.keyword_sections.keyword_section_model import \ - KeywordSectionModel # first-party +from tcex.api.tc.v3.intel_requirements.keyword_sections.keyword_section_model import ( + KeywordSectionModel, +) from tcex.api.tc.v3.tql.tql_operator import TqlOperator from tests.api.tc.v3.v3_helpers import TestV3, V3Helper @@ -90,15 +91,11 @@ def test_keywords_section(self): ir = self.v3_helper.create_ir() keyword_sections = [ KeywordSectionModel( - section_number=0, - compare_value='includes', - keywords=[{'value': 'keyword1'}] + section_number=0, compare_value='includes', keywords=[{'value': 'keyword1'}] ), KeywordSectionModel( - section_number=1, - compare_value='includes', - keywords=[{'value': 'keyword2'}] - ) + section_number=1, compare_value='includes', keywords=[{'value': 'keyword2'}] + ), ] ir.replace_keyword_section(keyword_sections) ir.update()