Skip to content
Snippets Groups Projects
Verified Commit 83cabe6f authored by Georg Krause's avatar Georg Krause
Browse files

Fix library tests

parent 3025d17c
No related branches found
No related tags found
1 merge request!1Add basic model tests
...@@ -26,7 +26,7 @@ class Library: ...@@ -26,7 +26,7 @@ class Library:
creation_date (Union[Unset, datetime.datetime]): creation_date (Union[Unset, datetime.datetime]):
privacy_level (Union[Unset, LibraryPrivacyLevelEnum]): privacy_level (Union[Unset, LibraryPrivacyLevelEnum]):
follow (Union[Unset, None, NestedLibraryFollow]): follow (Union[Unset, None, NestedLibraryFollow]):
latest_scan (Union[Unset, LibraryScan]): latest_scan (Union[Unset, None, LibraryScan]):
""" """
fid: str fid: str
...@@ -38,7 +38,7 @@ class Library: ...@@ -38,7 +38,7 @@ class Library:
creation_date: Union[Unset, datetime.datetime] = UNSET creation_date: Union[Unset, datetime.datetime] = UNSET
privacy_level: Union[Unset, LibraryPrivacyLevelEnum] = UNSET privacy_level: Union[Unset, LibraryPrivacyLevelEnum] = UNSET
follow: Union[Unset, None, NestedLibraryFollow] = UNSET follow: Union[Unset, None, NestedLibraryFollow] = UNSET
latest_scan: Union[Unset, LibraryScan] = UNSET latest_scan: Union[Unset, None, LibraryScan] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
...@@ -61,9 +61,9 @@ class Library: ...@@ -61,9 +61,9 @@ class Library:
if not isinstance(self.follow, Unset): if not isinstance(self.follow, Unset):
follow = self.follow.to_dict() if self.follow else None follow = self.follow.to_dict() if self.follow else None
latest_scan: Union[Unset, Dict[str, Any]] = UNSET latest_scan: Union[Unset, None, Dict[str, Any]] = UNSET
if not isinstance(self.latest_scan, Unset): if not isinstance(self.latest_scan, Unset):
latest_scan = self.latest_scan.to_dict() latest_scan = self.latest_scan.to_dict() if self.latest_scan else None
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
...@@ -129,8 +129,10 @@ class Library: ...@@ -129,8 +129,10 @@ class Library:
follow = NestedLibraryFollow.from_dict(_follow) follow = NestedLibraryFollow.from_dict(_follow)
_latest_scan = d.pop("latest_scan", UNSET) _latest_scan = d.pop("latest_scan", UNSET)
latest_scan: Union[Unset, LibraryScan] latest_scan: Union[Unset, None, LibraryScan]
if isinstance(_latest_scan, Unset): if _latest_scan is None:
latest_scan = None
elif isinstance(_latest_scan, Unset):
latest_scan = UNSET latest_scan = UNSET
else: else:
latest_scan = LibraryScan.from_dict(_latest_scan) latest_scan = LibraryScan.from_dict(_latest_scan)
......
...@@ -26,7 +26,7 @@ class LibraryRequest: ...@@ -26,7 +26,7 @@ class LibraryRequest:
creation_date (Union[Unset, datetime.datetime]): creation_date (Union[Unset, datetime.datetime]):
privacy_level (Union[Unset, LibraryPrivacyLevelEnum]): privacy_level (Union[Unset, LibraryPrivacyLevelEnum]):
follow (Union[Unset, None, NestedLibraryFollowRequest]): follow (Union[Unset, None, NestedLibraryFollowRequest]):
latest_scan (Union[Unset, LibraryScanRequest]): latest_scan (Union[Unset, None, LibraryScanRequest]):
""" """
fid: str fid: str
...@@ -37,7 +37,7 @@ class LibraryRequest: ...@@ -37,7 +37,7 @@ class LibraryRequest:
creation_date: Union[Unset, datetime.datetime] = UNSET creation_date: Union[Unset, datetime.datetime] = UNSET
privacy_level: Union[Unset, LibraryPrivacyLevelEnum] = UNSET privacy_level: Union[Unset, LibraryPrivacyLevelEnum] = UNSET
follow: Union[Unset, None, NestedLibraryFollowRequest] = UNSET follow: Union[Unset, None, NestedLibraryFollowRequest] = UNSET
latest_scan: Union[Unset, LibraryScanRequest] = UNSET latest_scan: Union[Unset, None, LibraryScanRequest] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
...@@ -59,9 +59,9 @@ class LibraryRequest: ...@@ -59,9 +59,9 @@ class LibraryRequest:
if not isinstance(self.follow, Unset): if not isinstance(self.follow, Unset):
follow = self.follow.to_dict() if self.follow else None follow = self.follow.to_dict() if self.follow else None
latest_scan: Union[Unset, Dict[str, Any]] = UNSET latest_scan: Union[Unset, None, Dict[str, Any]] = UNSET
if not isinstance(self.latest_scan, Unset): if not isinstance(self.latest_scan, Unset):
latest_scan = self.latest_scan.to_dict() latest_scan = self.latest_scan.to_dict() if self.latest_scan else None
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
...@@ -112,7 +112,11 @@ class LibraryRequest: ...@@ -112,7 +112,11 @@ class LibraryRequest:
latest_scan: Union[Unset, Tuple[None, bytes, str]] = UNSET latest_scan: Union[Unset, Tuple[None, bytes, str]] = UNSET
if not isinstance(self.latest_scan, Unset): if not isinstance(self.latest_scan, Unset):
latest_scan = (None, json.dumps(self.latest_scan.to_dict()).encode(), "application/json") latest_scan = (
(None, json.dumps(self.latest_scan.to_dict()).encode(), "application/json")
if self.latest_scan
else None
)
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update( field_dict.update(
...@@ -177,8 +181,10 @@ class LibraryRequest: ...@@ -177,8 +181,10 @@ class LibraryRequest:
follow = NestedLibraryFollowRequest.from_dict(_follow) follow = NestedLibraryFollowRequest.from_dict(_follow)
_latest_scan = d.pop("latest_scan", UNSET) _latest_scan = d.pop("latest_scan", UNSET)
latest_scan: Union[Unset, LibraryScanRequest] latest_scan: Union[Unset, None, LibraryScanRequest]
if isinstance(_latest_scan, Unset): if _latest_scan is None:
latest_scan = None
elif isinstance(_latest_scan, Unset):
latest_scan = UNSET latest_scan = UNSET
else: else:
latest_scan = LibraryScanRequest.from_dict(_latest_scan) latest_scan = LibraryScanRequest.from_dict(_latest_scan)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment