Exemple #1
0
 def test_content_type(self):
     """
     Use the first ``Content-Type`` header.
     """
     headers = Headers({b'Content-Type': [b'application/json',
                                          b'text/plain']})
     self.assertThat(
         content_type(headers),
         Equals(b'application/json'))
Exemple #2
0
 def test_missing(self):
     """
     Default to ``application/octet-stream`` if there is no ``Content-Type``
     header.
     """
     headers = Headers()
     self.assertThat(
         content_type(headers),
         Equals(b'application/octet-stream'))