예제 #1
0
    def test_get_text_returns_none_for_binary(self):
        mock_response = MagicMock(headers={'content-type': 'application/blah'})
        wc = BaseWebClient(None)

        rv = wc.get_text(mock_response)

        self.assertIs(rv, None)
예제 #2
0
    def test_get_text_returns_text(self):
        mock_response = MagicMock(headers={'content-type': 'text/html'}, text='some text')
        wc = BaseWebClient(None)

        rv = wc.get_text(mock_response)

        self.assertEqual(rv, 'some text')