Skip to content

Commit 0aa3a62

Browse files
committed
added multiple tests for test_type_safe__Fast_API_Routes__conversions
1 parent 80132ec commit 0aa3a62

4 files changed

Lines changed: 362 additions & 3 deletions

File tree

osbot_fast_api/utils/type_safe/BaseModel__To__Type_Safe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def convert_field_type(self, pydantic_type : Any
100100
args = get_args(pydantic_type)
101101
if args:
102102
inner_type = self.convert_field_type(args[0])
103-
return List[inner_type]
103+
return list[inner_type] # this has to be list (not List) , since with List we get: 'Type List cannot be instantiated; use list() instead'
104104
return list
105105

106106
elif origin is dict: # Handle Dict types

tests/unit/utils/type_safe/test_BaseModel__To__Dataclass.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from dataclasses import fields, is_dataclass, asdict, MISSING
55
from typing import List, Dict, Optional, Union, Set
66
from unittest import TestCase
7-
from osbot_utils.utils.Objects import __
87
from pydantic import BaseModel, Field
98
from osbot_fast_api.utils.type_safe.BaseModel__To__Dataclass import BaseModel__To__Dataclass, basemodel__to__dataclass
109

tests/unit/utils/type_safe/test_Dataclass__To__BaseModel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
import pytest
3-
from dataclasses import dataclass, field, fields, is_dataclass
3+
from dataclasses import dataclass, field
44
from typing import List, Dict, Optional, Union, Set
55
from unittest import TestCase
66
from pydantic import BaseModel, ValidationError

0 commit comments

Comments
 (0)