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.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/testtools/testtools/tests/test_content_type.py b/lib/testtools/testtools/tests/test_content_type.py
index 52f4afac05..9d8c0f6f7a 100644
--- a/lib/testtools/testtools/tests/test_content_type.py
+++ b/lib/testtools/testtools/tests/test_content_type.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2008 Jonathan M. Lange. See LICENSE for details.
+# Copyright (c) 2008 testtools developers. See LICENSE for details.
from testtools import TestCase
from testtools.matchers import Equals, MatchesException, Raises
@@ -31,6 +31,16 @@ class TestContentType(TestCase):
self.assertTrue(content_type1.__eq__(content_type2))
self.assertFalse(content_type1.__eq__(content_type3))
+ def test_basic_repr(self):
+ content_type = ContentType('text', 'plain')
+ self.assertThat(repr(content_type), Equals('text/plain'))
+
+ def test_extended_repr(self):
+ content_type = ContentType(
+ 'text', 'plain', {'foo': 'bar', 'baz': 'qux'})
+ self.assertThat(
+ repr(content_type), Equals('text/plain; foo="bar", baz="qux"'))
+
class TestBuiltinContentTypes(TestCase):