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'))
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'))