Skip to content

Commit

Permalink
Change: Use native typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
n-thumann committed Nov 10, 2023
1 parent 355bea6 commit 4090381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pontos/nvd/models/cve_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from dataclasses import dataclass
from datetime import datetime
from enum import Enum
from typing import List, Optional
from typing import Optional
from uuid import UUID

from pontos.models import Model
Expand Down Expand Up @@ -43,4 +43,4 @@ class CVEChange(Model):
cve_change_id: UUID
source_identifier: str
created: Optional[datetime] = None
details: Optional[List[Detail]] = None
details: Optional[list[Detail]] = None
6 changes: 3 additions & 3 deletions tests/nvd/cve_change_history/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


from datetime import datetime, timezone
from typing import Any, Dict, List, Optional
from typing import Any, Optional
from unittest.mock import MagicMock, patch
from uuid import UUID

Expand All @@ -19,7 +19,7 @@


def create_cve_changes_response(
cve_id: str, update: Optional[Dict[str, Any]] = None
cve_id: str, update: Optional[dict[str, Any]] = None
) -> MagicMock:
data = {
"cve_changes": [{"change": get_cve_change_data({"cve_id": cve_id})}],
Expand All @@ -33,7 +33,7 @@ def create_cve_changes_response(
return response


def create_cve_changes_responses(count: int = 2) -> List[MagicMock]:
def create_cve_changes_responses(count: int = 2) -> list[MagicMock]:
return [
create_cve_changes_response(f"CVE-{i}", {"total_results": count})
for i in range(1, count + 1)
Expand Down

0 comments on commit 4090381

Please sign in to comment.