Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
api-client-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
funkwhale
api-client-python
Commits
83cabe6f
Verified
Commit
83cabe6f
authored
2 years ago
by
Georg Krause
Browse files
Options
Downloads
Patches
Plain Diff
Fix library tests
parent
3025d17c
No related branches found
No related tags found
1 merge request
!1
Add basic model tests
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
funkwhale_api_client/models/library.py
+8
-6
8 additions, 6 deletions
funkwhale_api_client/models/library.py
funkwhale_api_client/models/library_request.py
+13
-7
13 additions, 7 deletions
funkwhale_api_client/models/library_request.py
with
21 additions
and
13 deletions
funkwhale_api_client/models/library.py
+
8
−
6
View file @
83cabe6f
...
...
@@ -26,7 +26,7 @@ class Library:
creation_date (Union[Unset, datetime.datetime]):
privacy_level (Union[Unset, LibraryPrivacyLevelEnum]):
follow (Union[Unset, None, NestedLibraryFollow]):
latest_scan (Union[Unset, LibraryScan]):
latest_scan (Union[Unset,
None,
LibraryScan]):
"""
fid
:
str
...
...
@@ -38,7 +38,7 @@ class Library:
creation_date
:
Union
[
Unset
,
datetime
.
datetime
]
=
UNSET
privacy_level
:
Union
[
Unset
,
LibraryPrivacyLevelEnum
]
=
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
)
def
to_dict
(
self
)
->
Dict
[
str
,
Any
]:
...
...
@@ -61,9 +61,9 @@ class Library:
if
not
isinstance
(
self
.
follow
,
Unset
):
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
):
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
.
update
(
self
.
additional_properties
)
...
...
@@ -129,8 +129,10 @@ class Library:
follow
=
NestedLibraryFollow
.
from_dict
(
_follow
)
_latest_scan
=
d
.
pop
(
"
latest_scan
"
,
UNSET
)
latest_scan
:
Union
[
Unset
,
LibraryScan
]
if
isinstance
(
_latest_scan
,
Unset
):
latest_scan
:
Union
[
Unset
,
None
,
LibraryScan
]
if
_latest_scan
is
None
:
latest_scan
=
None
elif
isinstance
(
_latest_scan
,
Unset
):
latest_scan
=
UNSET
else
:
latest_scan
=
LibraryScan
.
from_dict
(
_latest_scan
)
...
...
This diff is collapsed.
Click to expand it.
funkwhale_api_client/models/library_request.py
+
13
−
7
View file @
83cabe6f
...
...
@@ -26,7 +26,7 @@ class LibraryRequest:
creation_date (Union[Unset, datetime.datetime]):
privacy_level (Union[Unset, LibraryPrivacyLevelEnum]):
follow (Union[Unset, None, NestedLibraryFollowRequest]):
latest_scan (Union[Unset, LibraryScanRequest]):
latest_scan (Union[Unset,
None,
LibraryScanRequest]):
"""
fid
:
str
...
...
@@ -37,7 +37,7 @@ class LibraryRequest:
creation_date
:
Union
[
Unset
,
datetime
.
datetime
]
=
UNSET
privacy_level
:
Union
[
Unset
,
LibraryPrivacyLevelEnum
]
=
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
)
def
to_dict
(
self
)
->
Dict
[
str
,
Any
]:
...
...
@@ -59,9 +59,9 @@ class LibraryRequest:
if
not
isinstance
(
self
.
follow
,
Unset
):
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
):
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
.
update
(
self
.
additional_properties
)
...
...
@@ -112,7 +112,11 @@ class LibraryRequest:
latest_scan
:
Union
[
Unset
,
Tuple
[
None
,
bytes
,
str
]]
=
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
.
update
(
...
...
@@ -177,8 +181,10 @@ class LibraryRequest:
follow
=
NestedLibraryFollowRequest
.
from_dict
(
_follow
)
_latest_scan
=
d
.
pop
(
"
latest_scan
"
,
UNSET
)
latest_scan
:
Union
[
Unset
,
LibraryScanRequest
]
if
isinstance
(
_latest_scan
,
Unset
):
latest_scan
:
Union
[
Unset
,
None
,
LibraryScanRequest
]
if
_latest_scan
is
None
:
latest_scan
=
None
elif
isinstance
(
_latest_scan
,
Unset
):
latest_scan
=
UNSET
else
:
latest_scan
=
LibraryScanRequest
.
from_dict
(
_latest_scan
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment