Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_referrer.py   MapProxy(Download)
 
from mapproxy.response import Response
from mapproxy.security.referrer import ReferrerFilter, NONE, SELF, REGEX
 
 
    def test_no_referrer(self):
        app = TestApp(ReferrerFilter(self.check_app))
        app.get('/')
        assert self.check_app.called
 
    def test_none(self):
        app = TestApp(ReferrerFilter(self.check_app, [NONE]))
    def check_referrer(self, filter, referrer_header, allowed):
        app = TestApp(ReferrerFilter(self.check_app, filter))
        headers = {}
        if referrer_header:
            headers['Referer'] = referrer_header

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_referrer.py   mapproxy(Download)
 
from mapproxy.response import Response
from mapproxy.security.referrer import ReferrerFilter, NONE, SELF, REGEX
 
 
    def test_no_referrer(self):
        app = TestApp(ReferrerFilter(self.check_app))
        app.get('/')
        assert self.check_app.called
 
    def test_none(self):
        app = TestApp(ReferrerFilter(self.check_app, [NONE]))
    def check_referrer(self, filter, referrer_header, allowed):
        app = TestApp(ReferrerFilter(self.check_app, filter))
        headers = {}
        if referrer_header:
            headers['Referer'] = referrer_header