summaryrefslogtreecommitdiff
path: root/lib/testtools/testtools/tests/test_content_type.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/testtools/testtools/tests/test_content_type.py')
-rw-r--r--lib/testtools/testtools/tests/test_content_type.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/testtools/testtools/tests/test_content_type.py b/lib/testtools/testtools/tests/test_content_type.py
index d593a14eaf..52f4afac05 100644
--- a/lib/testtools/testtools/tests/test_content_type.py
+++ b/lib/testtools/testtools/tests/test_content_type.py
@@ -1,16 +1,18 @@
# Copyright (c) 2008 Jonathan M. Lange. See LICENSE for details.
from testtools import TestCase
-from testtools.matchers import Equals
+from testtools.matchers import Equals, MatchesException, Raises
from testtools.content_type import ContentType, UTF8_TEXT
class TestContentType(TestCase):
def test___init___None_errors(self):
- self.assertRaises(ValueError, ContentType, None, None)
- self.assertRaises(ValueError, ContentType, None, "traceback")
- self.assertRaises(ValueError, ContentType, "text", None)
+ raises_value_error = Raises(MatchesException(ValueError))
+ self.assertThat(lambda:ContentType(None, None), raises_value_error)
+ self.assertThat(lambda:ContentType(None, "traceback"),
+ raises_value_error)
+ self.assertThat(lambda:ContentType("text", None), raises_value_error)
def test___init___sets_ivars(self):
content_type = ContentType("foo", "bar")