Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
funkwhale
funkwhale
Commits
f8675c60
Verified
Commit
f8675c60
authored
Feb 18, 2020
by
Eliot Berriot
Browse files
Fixed failing tests
parent
14d5b0c6
Pipeline
#9714
passed with stages
in 9 minutes and 41 seconds
Changes
3
Pipelines
6
Hide whitespace changes
Inline
Side-by-side
api/funkwhale_api/common/cache.py
View file @
f8675c60
...
...
@@ -8,7 +8,7 @@ logger = logging.getLogger(__name__)
class
RedisClient
(
default
.
DefaultClient
):
def
get
(
self
,
key
,
default
=
None
,
version
=
None
,
client
=
None
):
try
:
return
super
().
get
(
key
,
default
=
None
,
version
=
N
on
e
,
client
=
None
)
return
super
().
get
(
key
,
default
=
default
,
version
=
versi
on
,
client
=
client
)
except
ValueError
as
e
:
if
"unsupported pickle protocol"
in
str
(
e
):
# pickle deserialization error
...
...
api/funkwhale_api/subsonic/renderers.py
View file @
f8675c60
import
collections
import
xml.etree.ElementTree
as
ET
from
rest_framework
import
renderers
...
...
@@ -40,7 +41,7 @@ def structure_payload(data):
payload
[
"error"
]
=
{
"code"
:
0
,
"message"
:
payload
.
pop
(
"detail"
)}
if
"error"
in
payload
:
payload
[
"status"
]
=
"failed"
return
payload
return
collections
.
OrderedDict
(
sorted
(
payload
.
items
(),
key
=
lambda
v
:
v
[
0
]))
class
SubsonicJSONRenderer
(
renderers
.
JSONRenderer
):
...
...
api/tests/subsonic/test_renderers.py
View file @
f8675c60
...
...
@@ -80,7 +80,7 @@ def test_xml_renderer_dict_to_xml():
def
test_xml_renderer
():
payload
=
{
"hello"
:
"world"
}
expected
=
'<?xml version="1.0" encoding="UTF-8"?>
\n
<subsonic-response funkwhaleVersion="{}" status="ok" type="funkwhale" version="1.16.0"
hello="world"
xmlns="http://subsonic.org/restapi" />'
# noqa
expected
=
'<?xml version="1.0" encoding="UTF-8"?>
\n
<subsonic-response funkwhaleVersion="{}"
hello="world"
status="ok" type="funkwhale" version="1.16.0" xmlns="http://subsonic.org/restapi" />'
# noqa
expected
=
expected
.
format
(
funkwhale_api
.
__version__
).
encode
()
renderer
=
renderers
.
SubsonicXMLRenderer
()
...
...
Floréal Toumikian
@floreal
mentioned in issue
#1026
·
Feb 19, 2020
mentioned in issue
#1026
mentioned in issue #1026
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment