aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjcass <john.cass77@gmail.com>2016-06-01 04:17:09 +0200
committerjcass <john.cass77@gmail.com>2016-06-01 04:17:09 +0200
commit20080cfc037c0aa281f613c045bccd719bf5668c (patch)
treea9c3bbf6a895f4c3ddaca17ba7227bed61606c05 /tests
parentaabde7966a7ffef083f73368ca6f2904a778a78f (diff)
downloadpydora-20080cfc037c0aa281f613c045bccd719bf5668c.tar.bz2
pydora-20080cfc037c0aa281f613c045bccd719bf5668c.tar.xz
pydora-20080cfc037c0aa281f613c045bccd719bf5668c.zip
Fix SearchResult model.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pandora/test_models.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/test_pandora/test_models.py b/tests/test_pandora/test_models.py
index 1ab7cd5..7383d85 100644
--- a/tests/test_pandora/test_models.py
+++ b/tests/test_pandora/test_models.py
@@ -294,12 +294,24 @@ class TestSearchResultItem(TestCase):
294 "song_name='song_name_mock', token='S0000000')") 294 "song_name='song_name_mock', token='S0000000')")
295 self.assertEqual(expected, repr(self.result)) 295 self.assertEqual(expected, repr(self.result))
296 296
297 def test_is_song_true(self): 297 def test_is_song(self):
298 assert self.result.is_song is True 298 assert self.result.is_song
299
300 self.result.token = 'R123456'
301 assert not self.result.is_song
302
303 def test_is_artist(self):
304 assert not self.result.is_artist
305
306 self.result.token = 'R123456'
307 assert self.result.is_artist
308
309 def test_is_composer(self):
310 assert not self.result.is_composer
311
312 self.result.token = 'C12345'
313 assert self.result.is_composer
299 314
300 def test_is_song_false(self):
301 self.result.song_name = None
302 assert self.result.is_song is False
303 315
304 def test_create_station_song(self): 316 def test_create_station_song(self):
305 self.result._api_client.create_station = Mock() 317 self.result._api_client.create_station = Mock()
@@ -308,7 +320,7 @@ class TestSearchResultItem(TestCase):
308 self.result._api_client.create_station.assert_called_with(track_token=self.result.token) 320 self.result._api_client.create_station.assert_called_with(track_token=self.result.token)
309 321
310 def test_create_station_artist(self): 322 def test_create_station_artist(self):
311 self.result.song_name = None 323 self.result.token = 'R123456'
312 self.result._api_client.create_station = Mock() 324 self.result._api_client.create_station = Mock()
313 325
314 self.result.create_station() 326 self.result.create_station()