コード例 #1
0
    def test_querystring_as_string(self):
        data = {"request": {"query_string": "foo=bar&password=hello&access_token=hello"}}

        proc = InvenioSanitizeProcessor(Mock())
        result = proc.process(data)

        self.assertTrue("request" in result)
        http = result["request"]
        self.assertEquals(http["query_string"], "foo=bar&password=hello&access_token=%(m)s" % dict(m=proc.MASK))
コード例 #2
0
    def test_http(self):
        data = {"request": {"data": VARS, "env": VARS, "headers": VARS, "cookies": VARS}}

        proc = InvenioSanitizeProcessor(Mock())
        result = proc.process(data)

        self.assertTrue("request" in result)
        http = result["request"]
        for n in ("data", "env", "headers", "cookies"):
            self.assertTrue(n in http)
            self._check_vars_sanitized(http[n], proc)
コード例 #3
0
    def test_querystring_as_string(self):
        data = {
            'request': {
                'query_string': 'foo=bar&password=hello&access_token=hello',
            }
        }

        proc = InvenioSanitizeProcessor(Mock())
        result = proc.process(data)

        self.assertTrue('request' in result)
        http = result['request']
        self.assertEquals(
            http['query_string'],
            'foo=bar&password=hello&access_token=%(m)s' % dict(m=proc.MASK))
コード例 #4
0
    def test_querystring_as_string(self):
        data = {
            'request': {
                'query_string': 'foo=bar&password=hello&access_token=hello',
            }
        }

        proc = InvenioSanitizeProcessor(Mock())
        result = proc.process(data)

        self.assertTrue('request' in result)
        http = result['request']
        self.assertEquals(
            http['query_string'],
            'foo=bar&password=hello&access_token=%(m)s' % dict(m=proc.MASK)
        )
コード例 #5
0
    def test_http(self):
        data = {
            'request': {
                'data': VARS,
                'env': VARS,
                'headers': VARS,
                'cookies': VARS,
            }
        }

        proc = InvenioSanitizeProcessor(Mock())
        result = proc.process(data)

        self.assertTrue('request' in result)
        http = result['request']
        for n in ('data', 'env', 'headers', 'cookies'):
            self.assertTrue(n in http)
            self._check_vars_sanitized(http[n], proc)
コード例 #6
0
    def test_http(self):
        data = {
            'request': {
                'data': VARS,
                'env': VARS,
                'headers': VARS,
                'cookies': VARS,
            }
        }

        proc = InvenioSanitizeProcessor(Mock())
        result = proc.process(data)

        self.assertTrue('request' in result)
        http = result['request']
        for n in ('data', 'env', 'headers', 'cookies'):
            self.assertTrue(n in http)
            self._check_vars_sanitized(http[n], proc)