Skip to content

Commit cca053d

Browse files
authored
Fix sending JSON (#329)
1 parent 5bec3aa commit cca053d

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

src/spotifyaio/spotify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async def _request(
107107
method,
108108
url,
109109
headers=headers,
110-
data=data,
110+
json=data,
111111
params=params,
112112
)
113113
except asyncio.TimeoutError as exception:

tests/test_spotify.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ async def test_get_playback_state(
122122
METH_GET,
123123
headers=HEADERS,
124124
params={"additional_types": "track,episode"},
125-
data=None,
125+
json=None,
126126
)
127127

128128

@@ -142,7 +142,7 @@ async def test_get_no_playback_state(
142142
METH_GET,
143143
headers=HEADERS,
144144
params={"additional_types": "track,episode"},
145-
data=None,
145+
json=None,
146146
)
147147

148148

@@ -159,7 +159,7 @@ async def test_transfer_playback(
159159
f"{SPOTIFY_URL}/v1/me/player",
160160
METH_PUT,
161161
headers=HEADERS,
162-
data={"device_ids": ["test"]},
162+
json={"device_ids": ["test"]},
163163
params=None,
164164
)
165165

@@ -180,7 +180,7 @@ async def test_get_devices(
180180
responses.assert_called_once_with(
181181
f"{SPOTIFY_URL}/v1/me/player/devices",
182182
headers=HEADERS,
183-
data=None,
183+
json=None,
184184
params=None,
185185
)
186186

@@ -201,7 +201,7 @@ async def test_get_current_playing(
201201
responses.assert_called_once_with(
202202
f"{SPOTIFY_URL}/v1/me/player/currently-playing",
203203
headers=HEADERS,
204-
data=None,
204+
json=None,
205205
params=None,
206206
)
207207

@@ -221,7 +221,7 @@ async def test_get_no_current_playing_state(
221221
f"{SPOTIFY_URL}/v1/me/player/currently-playing",
222222
headers=HEADERS,
223223
params=None,
224-
data=None,
224+
json=None,
225225
)
226226

227227

@@ -287,7 +287,7 @@ async def test_resume_playback(
287287
METH_PUT,
288288
headers=HEADERS,
289289
params=expected_params,
290-
data=expected_data,
290+
json=expected_data,
291291
)
292292

293293

@@ -319,7 +319,7 @@ async def test_pause_playback(
319319
METH_PUT,
320320
headers=HEADERS,
321321
params=expected_params,
322-
data=None,
322+
json=None,
323323
)
324324

325325

@@ -351,7 +351,7 @@ async def test_next_track(
351351
METH_POST,
352352
headers=HEADERS,
353353
params=expected_params,
354-
data=None,
354+
json=None,
355355
)
356356

357357

@@ -383,7 +383,7 @@ async def test_previous_track(
383383
METH_POST,
384384
headers=HEADERS,
385385
params=expected_params,
386-
data=None,
386+
json=None,
387387
)
388388

389389

@@ -418,7 +418,7 @@ async def test_seek_track(
418418
METH_PUT,
419419
headers=HEADERS,
420420
params=expected_params,
421-
data=None,
421+
json=None,
422422
)
423423

424424

@@ -455,7 +455,7 @@ async def test_set_repeat(
455455
METH_PUT,
456456
headers=HEADERS,
457457
params=expected_params,
458-
data=None,
458+
json=None,
459459
)
460460

461461

@@ -490,7 +490,7 @@ async def test_set_volume(
490490
METH_PUT,
491491
headers=HEADERS,
492492
params=expected_params,
493-
data=None,
493+
json=None,
494494
)
495495

496496

@@ -525,7 +525,7 @@ async def test_set_shuffle(
525525
METH_PUT,
526526
headers=HEADERS,
527527
params=expected_params,
528-
data=None,
528+
json=None,
529529
)
530530

531531

@@ -558,7 +558,7 @@ async def test_add_to_queue(
558558
METH_POST,
559559
headers=HEADERS,
560560
params=None,
561-
data=expected_data,
561+
json=expected_data,
562562
)
563563

564564

@@ -580,7 +580,7 @@ async def test_get_album(
580580
METH_GET,
581581
headers=HEADERS,
582582
params=None,
583-
data=None,
583+
json=None,
584584
)
585585

586586

@@ -602,7 +602,7 @@ async def test_get_playlist(
602602
METH_GET,
603603
headers=HEADERS,
604604
params=None,
605-
data=None,
605+
json=None,
606606
)
607607

608608

@@ -632,7 +632,7 @@ async def test_get_current_users_playlists(
632632
METH_GET,
633633
headers=HEADERS,
634634
params={"limit": 48},
635-
data=None,
635+
json=None,
636636
)
637637

638638

@@ -661,7 +661,7 @@ async def test_get_playlist_variation(
661661
METH_GET,
662662
headers=HEADERS,
663663
params=None,
664-
data=None,
664+
json=None,
665665
)
666666

667667

@@ -683,7 +683,7 @@ async def test_get_featured_playlists(
683683
METH_GET,
684684
headers=HEADERS,
685685
params={"limit": 48},
686-
data=None,
686+
json=None,
687687
)
688688

689689

@@ -705,7 +705,7 @@ async def test_get_category_playlists(
705705
METH_GET,
706706
headers=HEADERS,
707707
params={"limit": 48},
708-
data=None,
708+
json=None,
709709
)
710710

711711

@@ -727,7 +727,7 @@ async def test_get_current_user(
727727
METH_GET,
728728
headers=HEADERS,
729729
params=None,
730-
data=None,
730+
json=None,
731731
)
732732

733733

@@ -749,7 +749,7 @@ async def test_get_user(
749749
METH_GET,
750750
headers=HEADERS,
751751
params=None,
752-
data=None,
752+
json=None,
753753
)
754754

755755

@@ -771,7 +771,7 @@ async def test_get_episode(
771771
METH_GET,
772772
headers=HEADERS,
773773
params=None,
774-
data=None,
774+
json=None,
775775
)
776776

777777

@@ -793,7 +793,7 @@ async def test_get_show(
793793
METH_GET,
794794
headers=HEADERS,
795795
params=None,
796-
data=None,
796+
json=None,
797797
)
798798

799799

@@ -815,7 +815,7 @@ async def test_get_following_artists(
815815
METH_GET,
816816
headers=HEADERS,
817817
params={"type": "artist", "limit": 48},
818-
data=None,
818+
json=None,
819819
)
820820

821821

@@ -837,7 +837,7 @@ async def test_get_saved_albums(
837837
METH_GET,
838838
headers=HEADERS,
839839
params={"limit": 48},
840-
data=None,
840+
json=None,
841841
)
842842

843843

@@ -859,7 +859,7 @@ async def test_get_saved_tracks(
859859
METH_GET,
860860
headers=HEADERS,
861861
params={"limit": 48},
862-
data=None,
862+
json=None,
863863
)
864864

865865

@@ -881,7 +881,7 @@ async def test_get_saved_shows(
881881
METH_GET,
882882
headers=HEADERS,
883883
params={"limit": 48},
884-
data=None,
884+
json=None,
885885
)
886886

887887

@@ -903,7 +903,7 @@ async def test_get_recently_played_tracks(
903903
METH_GET,
904904
headers=HEADERS,
905905
params={"limit": 48},
906-
data=None,
906+
json=None,
907907
)
908908

909909

@@ -925,7 +925,7 @@ async def test_get_top_artists(
925925
METH_GET,
926926
headers=HEADERS,
927927
params={"limit": 48},
928-
data=None,
928+
json=None,
929929
)
930930

931931

@@ -947,7 +947,7 @@ async def test_get_top_tracks(
947947
METH_GET,
948948
headers=HEADERS,
949949
params={"limit": 48},
950-
data=None,
950+
json=None,
951951
)
952952

953953

@@ -969,7 +969,7 @@ async def test_get_new_releases(
969969
METH_GET,
970970
headers=HEADERS,
971971
params={"limit": 48},
972-
data=None,
972+
json=None,
973973
)
974974

975975

@@ -991,7 +991,7 @@ async def test_get_category(
991991
METH_GET,
992992
headers=HEADERS,
993993
params=None,
994-
data=None,
994+
json=None,
995995
)
996996

997997

@@ -1013,7 +1013,7 @@ async def test_get_artist(
10131013
METH_GET,
10141014
headers=HEADERS,
10151015
params=None,
1016-
data=None,
1016+
json=None,
10171017
)
10181018

10191019

@@ -1035,7 +1035,7 @@ async def test_get_artist_albums(
10351035
METH_GET,
10361036
headers=HEADERS,
10371037
params={"limit": 48},
1038-
data=None,
1038+
json=None,
10391039
)
10401040

10411041

@@ -1057,7 +1057,7 @@ async def test_get_show_episodes(
10571057
METH_GET,
10581058
headers=HEADERS,
10591059
params={"limit": 48},
1060-
data=None,
1060+
json=None,
10611061
)
10621062

10631063

@@ -1079,5 +1079,5 @@ async def test_get_categories(
10791079
METH_GET,
10801080
headers=HEADERS,
10811081
params={"limit": 48},
1082-
data=None,
1082+
json=None,
10831083
)

0 commit comments

Comments
 (0)