def _mock_retrieve_content(mock, url): filename = urlparse(url).path _file = open('./templates%s' % filename, 'r') content = _file.read() _file.close() return content
def _mock_retreive_content(mock, url): filename = urlparse(url).path file = open('./templates%s' % filename, 'r') html = file.read() file.close() return html
def _retreive_content(self, url): filename = urlparse(url).path file = open("./templates/%s" % filename, "r") html = file.read() file.close() return html
def _mock_retrieve_headers(mock, url): filename = urlparse(url).path headers = { 'Content-Type': mimetypes.guess_type(filename)[0] or 'application/octet-stream' } return headers
def _mock_retrieve_headers(mock, url): filename = urlparse(url).path headers = { 'Content-Type': mimetypes.guess_type(filename)[0] or 'application/octet-stream' } status_code = 200 return headers, status_code
def _mock_retrieve_content(mock, url): if '.html' not in url: filename = '/generic/all_properties.html' else: filename = urlparse(url).path _file = open('./templates%s' % filename, 'r') content = _file.read() _file.close() status_code = 200 return content, status_code
def _mock_retrieve_oembed_data(mock, url): if '.json' not in url: return {}, 404 try: filename = urlparse(url).path _file = open('./json%s' % filename, 'r') content = _file.read() _file.close() status_code = 200 except Exception as e: raise LassieError(e) return json.loads(content), status_code