Beispiel #1
0
    def test_smaller(self):
        context = get_default_context({})
        context['request']['body']['parsed'] = {'dict': {'key': 1}}

        selector = 'request.body.parsed.dict.key'
        compare_to = 2

        self.assertEqual(
            context,
            compare(context,
                    selector=selector,
                    comparator='<',
                    compare_to=compare_to))
Beispiel #2
0
    def test_equal(self):
        context = get_default_context({})
        context['request']['body']['parsed'] = {'dict': {'key': 'value'}}

        selector = 'request.body.parsed.dict.key'
        compare_to = 'value'

        self.assertEqual(
            context,
            compare(context,
                    selector=selector,
                    comparator='==',
                    compare_to=compare_to))