Skip to content

Commit

Permalink
Catch specific exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Kuttler committed Apr 15, 2012
1 parent 713e320 commit f3421a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions piwikapi/tests/tracking.py
Expand Up @@ -150,7 +150,7 @@ def test_set_visitor_id(self):
try:
self.pt.set_visitor_id(incorrect_id)
incorrect_id_allowed = True
except Exception:
except InvalidParameter:
incorrect_id_allowed = False
self.assertFalse(
incorrect_id_allowed,
Expand All @@ -161,7 +161,7 @@ def test_set_visitor_id(self):
try:
self.pt.set_visitor_id(correct_id)
correct_id_allowed = True
except Exception:
except InvalidParameter:
correct_id_allowed = False
self.assertTrue(
correct_id_allowed,
Expand All @@ -183,7 +183,7 @@ def test_incorrect_custom_variables_invalid(self):
try:
saved = self.pt.set_custom_variable('a', 'foo', value, 'page')
invalid_id = True
except Exception:
except InvalidParameter:
invalid_id = False
self.assertFalse(
invalid_id,
Expand All @@ -193,7 +193,7 @@ def test_incorrect_custom_variables_invalid(self):
try:
saved = self.pt.set_custom_variable(1, 'foo', value, 'foo')
invalid_scope = True
except Exception:
except InvalidParameter:
invalid_scope = False
self.assertFalse(
invalid_scope,
Expand Down

0 comments on commit f3421a8

Please sign in to comment.