Skip to content

Commit

Permalink
fixed some tests in code of 200 (which is not documented at spotify lol)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Eichhorn committed Jul 9, 2024
1 parent ac384e4 commit 454ca05
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/SpotifyConnect/SPOCApiNext.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ SPOCApiNext >> skipToNextOn: aDevice [

{
#category : #'api-call',
#'squeak_changestamp' : 'VE 7/9/2024 11:22'
#'squeak_changestamp' : 'VE 7/9/2024 11:51'
}
SPOCApiNext >> tinkerReponseContent: aContentStream [

^ SPOCApiEndpointResult new response: (WebResponse protocol: '' code: 204)
]
3 changes: 2 additions & 1 deletion src/SpotifyConnect/SPOCApiPause.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ SPOCApiPause >> pauseOn: aDevice [

{
#category : #'api-call',
#'squeak_changestamp' : 'VE 7/9/2024 11:21'
#'squeak_changestamp' : 'VE 7/9/2024 11:49'
}
SPOCApiPause >> tinkerReponseContent: aContentStream [

^ SPOCApiEndpointResult new response: (WebResponse protocol: '' code: 204)
]
4 changes: 3 additions & 1 deletion src/SpotifyConnect/SPOCApiPlay.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ SPOCApiPlay >> playTrack: aString withPlaylist: anotherString on: aDevice [

{
#category : #parameters,
#'squeak_changestamp' : 'VE 7/9/2024 11:21'
#'squeak_changestamp' : 'VE 7/9/2024 11:51'
}
SPOCApiPlay >> tinkerReponseContent: aContentStream [

^ SPOCApiEndpointResult new response: (WebResponse protocol: '' code: 204)
]
3 changes: 2 additions & 1 deletion src/SpotifyConnect/SPOCApiPrevious.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ SPOCApiPrevious >> skipToPreviousOn: aDevice [

{
#category : #'api-call',
#'squeak_changestamp' : 'VE 7/9/2024 11:23'
#'squeak_changestamp' : 'VE 7/9/2024 11:51'
}
SPOCApiPrevious >> tinkerReponseContent: aContentStream [

^ SPOCApiEndpointResult new response: (WebResponse protocol: '' code: 204)
]
3 changes: 2 additions & 1 deletion src/SpotifyConnect/SPOCAuthTestResource.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ SPOCAuthTestResource >> auth: anObject [

{
#category : #setup,
#'squeak_changestamp' : 'TL 6/10/2024 04:46'
#'squeak_changestamp' : 'VE 7/9/2024 11:36'
}
SPOCAuthTestResource >> setUp [

SPOCAuthorizer refreshToken: nil.
self auth: SPOCAuthorizer new.
self auth startAuthorization.
[self auth isAuthorized]
Expand Down
9 changes: 5 additions & 4 deletions src/SpotifyConnect/SPOCTestApiPause.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ SPOCTestApiPause >> setUp [

{
#category : #testing,
#'squeak_changestamp' : 'TL 6/10/2024 23:12'
#'squeak_changestamp' : 'VE 7/9/2024 11:50'
}
SPOCTestApiPause >> testApiPauseExecute [

| dict res playbackState |
| dict res playbackState code |
playbackState := self getPlaybackState.
dict := Dictionary new
at: #device_id put: playbackState device id;
yourself.
res := self apiEndpoint execute: dict.
code := res response code.
playbackState isPlaying
ifTrue: [self assert: (res response code = 204)]
ifFalse: [self assert: (res response code = 403)]
ifTrue: [self assert: (code = 204)]
ifFalse: [self assert: (code = 403)]
]

{
Expand Down
2 changes: 1 addition & 1 deletion src/SpotifyConnect/SPOCTestApiPrevious.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SPOCTestApiPrevious >> testApiPreviousExecute [

{
#category : #testing,
#'squeak_changestamp' : 'TL 6/24/2024 02:09'
#'squeak_changestamp' : 'VE 7/9/2024 11:32'
}
SPOCTestApiPrevious >> testSkipToPreviousOn [

Expand Down
10 changes: 9 additions & 1 deletion src/SpotifyConnect/SPOCTestAuthorizerProcess.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ Class {
#'squeak_changestamp' : 'OW 7/9/2024 10:44'
}

{
#category : #testing,
#'squeak_changestamp' : 'VE 7/9/2024 11:34'
}
SPOCTestAuthorizerProcess >> setUp [

]

{
#category : #testing,
#'squeak_changestamp' : 'VE 6/20/2024 19:56'
Expand Down Expand Up @@ -53,7 +61,7 @@ SPOCTestAuthorizerProcess >> testCallbackErrors [

{
#category : #testing,
#'squeak_changestamp' : 'TL 7/8/2024 20:13'
#'squeak_changestamp' : 'VE 7/9/2024 11:35'
}
SPOCTestAuthorizerProcess >> testStartAuthorization [

Expand Down

0 comments on commit 454ca05

Please sign in to comment.