Exemple #1
0
    def test_successful_get(self):

        class RequestMock(object):
            headers = {'content-length': 10}
            content = open('sainsburys_cl/test/test_product_details.html').read()

        with patch('sainsburys_cl.main.requests') as mock_requests:
            mock_requests.get.return_value = RequestMock()
            result = get_html('')
            assert(result.size == '0.0kb')
            assert(result.content)
Exemple #2
0
 def test_failed_get(self):
     assert(get_html('') == (None, None))