X-Git-Url: http://git.samba.org/samba.git/?a=blobdiff_plain;f=lib%2Ftesttools%2Ftesttools%2Ftests%2Ftest_content_type.py;h=52f4afac0559e2112bab211bae74b493001b08f7;hb=297434055e2e2b28a2f9cacc09a30786edf8903a;hp=d593a14eaf014fad4da8cf82e2b9b4c3d1e4d686;hpb=e6974b0ff0100bb292d57e58ae11bc2e6b0d4053;p=nivanova%2Fsamba-autobuild%2F.git diff --git a/lib/testtools/testtools/tests/test_content_type.py b/lib/testtools/testtools/tests/test_content_type.py index d593a14eaf0..52f4afac055 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")