aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjcass <john.cass77@gmail.com>2015-12-28 18:36:16 +0200
committerjcass <john.cass77@gmail.com>2015-12-28 18:36:16 +0200
commite6335911d8763cf4bfaa709364e0dc6fc9d60f12 (patch)
tree438eda651605e3f222e4f5913d8d24846c3cfd2b /tests
parentd2a520dbf6257986128d14a6c7d23aa37725d5e3 (diff)
downloadpydora-e6335911d8763cf4bfaa709364e0dc6fc9d60f12.tar.bz2
pydora-e6335911d8763cf4bfaa709364e0dc6fc9d60f12.tar.xz
pydora-e6335911d8763cf4bfaa709364e0dc6fc9d60f12.zip
Align with using Pandora's ParameterMissing exception for ValueErrors.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pandora/test_client.py4
-rw-r--r--tests/test_pandora/test_models.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_pandora/test_client.py b/tests/test_pandora/test_client.py
index 24d9734..69fb632 100644
--- a/tests/test_pandora/test_client.py
+++ b/tests/test_pandora/test_client.py
@@ -1,7 +1,7 @@
1from unittest import TestCase 1from unittest import TestCase
2 2
3from pandora.client import APIClient, BaseAPIClient 3from pandora.client import APIClient, BaseAPIClient
4from pandora.errors import InvalidAuthToken 4from pandora.errors import InvalidAuthToken, ParameterMissing
5from pandora.py2compat import Mock, call, patch 5from pandora.py2compat import Mock, call, patch
6from tests.test_pandora.test_models import TestAdItem 6from tests.test_pandora.test_models import TestAdItem
7 7
@@ -117,4 +117,4 @@ class TestGettingAds(TestCase):
117 client = APIClient(transport, None, None, None, None) 117 client = APIClient(transport, None, None, None, None)
118 client.get_ad_metadata = Mock() 118 client.get_ad_metadata = Mock()
119 119
120 self.assertRaises(ValueError, client.get_ad_item, '', 'mock_token') 120 self.assertRaises(ParameterMissing, client.get_ad_item, '', 'mock_token')
diff --git a/tests/test_pandora/test_models.py b/tests/test_pandora/test_models.py
index 06c988c..538cee5 100644
--- a/tests/test_pandora/test_models.py
+++ b/tests/test_pandora/test_models.py
@@ -3,6 +3,7 @@ from datetime import datetime
3from pandora.py2compat import Mock, patch 3from pandora.py2compat import Mock, patch
4from pandora import APIClient 4from pandora import APIClient
5from pandora.models.pandora import AdItem, PlaylistModel 5from pandora.models.pandora import AdItem, PlaylistModel
6from pandora.errors import ParameterMissing
6 7
7import pandora.models as m 8import pandora.models as m
8 9
@@ -235,7 +236,7 @@ class TestAdItem(TestCase):
235 assert self.result._api_client.register_ad.called 236 assert self.result._api_client.register_ad.called
236 237
237 def test_register_ad_raises_exception_if_no_tracking_tokens_available(self): 238 def test_register_ad_raises_exception_if_no_tracking_tokens_available(self):
238 with self.assertRaises(ValueError): 239 with self.assertRaises(ParameterMissing):
239 self.result.tracking_tokens = [] 240 self.result.tracking_tokens = []
240 self.result._api_client.register_ad = Mock(spec=AdItem) 241 self.result._api_client.register_ad = Mock(spec=AdItem)
241 242