diff options
author | jcass <john.cass77@gmail.com> | 2015-12-28 18:36:16 +0200 |
---|---|---|
committer | jcass <john.cass77@gmail.com> | 2015-12-28 18:36:16 +0200 |
commit | e6335911d8763cf4bfaa709364e0dc6fc9d60f12 (patch) | |
tree | 438eda651605e3f222e4f5913d8d24846c3cfd2b /tests | |
parent | d2a520dbf6257986128d14a6c7d23aa37725d5e3 (diff) | |
download | pydora-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.py | 4 | ||||
-rw-r--r-- | tests/test_pandora/test_models.py | 3 |
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 @@ | |||
1 | from unittest import TestCase | 1 | from unittest import TestCase |
2 | 2 | ||
3 | from pandora.client import APIClient, BaseAPIClient | 3 | from pandora.client import APIClient, BaseAPIClient |
4 | from pandora.errors import InvalidAuthToken | 4 | from pandora.errors import InvalidAuthToken, ParameterMissing |
5 | from pandora.py2compat import Mock, call, patch | 5 | from pandora.py2compat import Mock, call, patch |
6 | from tests.test_pandora.test_models import TestAdItem | 6 | from 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 | |||
3 | from pandora.py2compat import Mock, patch | 3 | from pandora.py2compat import Mock, patch |
4 | from pandora import APIClient | 4 | from pandora import APIClient |
5 | from pandora.models.pandora import AdItem, PlaylistModel | 5 | from pandora.models.pandora import AdItem, PlaylistModel |
6 | from pandora.errors import ParameterMissing | ||
6 | 7 | ||
7 | import pandora.models as m | 8 | import 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 | ||