Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck committed Oct 8, 2023
1 parent 6cf65de commit aafe2f9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tests/test_model_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
# Copyright (c) OWASP Foundation. All Rights Reserved.

import datetime
from typing import List
from typing import Any, List
from unittest import TestCase
from unittest.mock import Mock, patch
from unittest.mock import patch

from cyclonedx.exception.model import NoPropertiesProvidedException
from cyclonedx.model import (
Expand Down Expand Up @@ -105,7 +105,7 @@ def test_sort(self) -> None:
class TestModelComponent(TestCase):

@patch('cyclonedx.model.bom_ref.uuid4', side_effect=uuid_generator(version=4))
def test_empty_basic_component(self, *_, **__) -> None:
def test_empty_basic_component(self, *_: Any, **__: Any) -> None:
c = Component(name='test-component')
self.assertEqual(c.name, 'test-component')
self.assertEqual(c.type, ComponentType.LIBRARY)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_model_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.

from typing import Any
from unittest import TestCase
from unittest.mock import Mock, patch

Expand Down Expand Up @@ -45,7 +45,7 @@ def test_minimal_service(self, mock_uuid: Mock) -> None:
self.assertFalse(s.properties)

@patch('cyclonedx.model.bom_ref.uuid4', side_effect=uuid_generator(version=4))
def test_service_with_services(self, *_, **__) -> None:
def test_service_with_services(self, *_: Any, **__: Any) -> None:
parent_service = Service(name='parent-service')
parent_service.services = [
Service(name='child-service-1'),
Expand Down
5 changes: 3 additions & 2 deletions tests/test_model_vulnerability.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

from datetime import datetime, timedelta
from decimal import Decimal
from typing import Any
from unittest import TestCase
from unittest.mock import Mock, patch
from unittest.mock import patch

from cyclonedx.model import XsUri
from cyclonedx.model.impact_analysis import ImpactAnalysisAffectedStatus
Expand Down Expand Up @@ -168,7 +169,7 @@ def test_v_source_get_localised_vector_other_2(self) -> None:
)

@patch('cyclonedx.model.bom_ref.uuid4', side_effect=uuid_generator(version=4))
def test_empty_vulnerability(self, *_, **__) -> None:
def test_empty_vulnerability(self, *_: Any, **__: Any) -> None:
v = Vulnerability()
self.assertEqual(str(v.bom_ref), '00000000-0000-4000-8000-000000000001')
self.assertIsNone(v.id)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_real_world_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import unittest
from datetime import datetime
from os.path import join
from typing import Any
from unittest.mock import patch

from cyclonedx.model.bom import Bom
Expand All @@ -28,6 +29,6 @@
@patch('cyclonedx.model.bom.get_now_utc', return_value=datetime.fromisoformat('2023-01-07 13:44:32.312678+00:00'))
class TestDeserializeeRealWorldExamples(unittest.TestCase):

def test_webgoat_6_1(self, *_, **__) -> None:
def test_webgoat_6_1(self, *_: Any, **__: Any) -> None:
with open(join(OWN_DATA_DIRECTORY, 'xml', '1.4', 'webgoat-6.1.xml')) as input_xml:
Bom.from_xml(input_xml)

0 comments on commit aafe2f9

Please sign in to comment.