How to use the premailer.test_premailer.MockResponse function in premailer

To help you get started, we’ve selected a few premailer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github peterbe / premailer / premailer / test_premailer.py View on Github external
def mocked_urlopen(url):
            ok_(url.startswith('https://'))
            if 'style1.css' in url:
                return MockResponse(
                    "h1 { color: brown }"
                )
            if 'style2.css' in url:
                return MockResponse(
                    "h2 { color: pink }"
                )
            if 'style3.css' in url:
                return MockResponse(
                    "h3 { color: red }", gzip=True
                )
github peterbe / premailer / premailer / test_premailer.py View on Github external
def mocked_urlopen(url):
            if 'style1.css' in url:
                return MockResponse(
                    "h1 { color: brown }"
                )
            if 'style2.css' in url:
                return MockResponse(
                    "h2 { color: pink }"
                )
            if 'style3.css' in url:
                return MockResponse(
                    "h3 { color: red }", gzip=True
                )
github peterbe / premailer / premailer / test_premailer.py View on Github external
def mocked_urlopen(url):
            ok_(url.startswith('https://'))
            if 'style1.css' in url:
                return MockResponse(
                    "h1 { color: brown }"
                )
            if 'style2.css' in url:
                return MockResponse(
                    "h2 { color: pink }"
                )
            if 'style3.css' in url:
                return MockResponse(
                    "h3 { color: red }", gzip=True
                )
github peterbe / premailer / premailer / test_premailer.py View on Github external
def mocked_urlopen(url):
            if 'style1.css' in url:
                return MockResponse(
                    "h1 { color: brown }"
                )
            if 'style2.css' in url:
                return MockResponse(
                    "h2 { color: pink }"
                )
            if 'style3.css' in url:
                return MockResponse(
                    "h3 { color: red }", gzip=True
                )
github peterbe / premailer / premailer / test_premailer.py View on Github external
def mocked_urlopen(url):
            if url == 'http://www.peterbe.com/style.css':
                return MockResponse(
                    "h1 { color: brown }"
                )
            raise NotImplementedError(url)
github peterbe / premailer / premailer / test_premailer.py View on Github external
def mocked_urlopen(url):
            if 'style1.css' in url:
                return MockResponse(
                    "h1 { color: brown }"
                )
            if 'style2.css' in url:
                return MockResponse(
                    "h2 { color: pink }"
                )
            if 'style3.css' in url:
                return MockResponse(
                    "h3 { color: red }", gzip=True
                )
github peterbe / premailer / premailer / test_premailer.py View on Github external
def mocked_urlopen(url):
            ok_(url.startswith('https://'))
            if 'style1.css' in url:
                return MockResponse(
                    "h1 { color: brown }"
                )
            if 'style2.css' in url:
                return MockResponse(
                    "h2 { color: pink }"
                )
            if 'style3.css' in url:
                return MockResponse(
                    "h3 { color: red }", gzip=True
                )