Example #1
0
 def test_with_invalid_values_should_correctly_parse_value(self):
     for params in FILTER_PARAMS_DATA:
         for test_data in params["invalid_values"]:
             BaseFilter.compile_regex(
                 {"name": "x", "params": [params["type"]]}
             )
             filter_instance = BaseFilter(f"x({test_data})")
             expect(filter_instance.params).to_be_null()
Example #2
0
    class WithInvalidValues(Vows.Context):
        def topic(self, test_data):
            for value in test_data['invalid_values']:
                yield(test_data['type'], value)

        def should_not_parse_invalid_value(self, (type, test_data)):
            BaseFilter.compile_regex({'name': 'x', 'params': [type]})
            f = BaseFilter('x(%s)' % test_data)
            expect(f.params).to_be_null()
Example #3
0
    class WithValidValues(Vows.Context):
        def topic(self, test_data):
            for value in test_data['values']:
                yield(test_data['type'], value[0], value[1])

        def should_correctly_parse_value(self, (type, test_data, expected_data)):
            BaseFilter.compile_regex({'name': 'x', 'params': [type]})
            f = BaseFilter('x(%s)' % test_data)
            expect(f.params[0]).to_equal(expected_data)
Example #4
0
 def test_with_invalid_values_should_correctly_parse_value(self):
     for params in FILTER_PARAMS_DATA:
         for test_data in params['invalid_values']:
             BaseFilter.compile_regex({
                 'name': 'x',
                 'params': [params['type']]
             })
             f = BaseFilter('x(%s)' % test_data)
             expect(f.params).to_be_null()
Example #5
0
 def should_not_parse_invalid_value(self, data):
     type, test_data = data
     BaseFilter.compile_regex({'name': 'x', 'params': [type]})
     f = BaseFilter('x(%s)' % test_data)
     expect(f.params).to_be_null()
Example #6
0
 def should_correctly_parse_value(self, data):
     type, test_data, expected_data = data
     BaseFilter.compile_regex({'name': 'x', 'params': [type]})
     f = BaseFilter('x(%s)' % test_data)
     expect(f.params[0]).to_equal(expected_data)
Example #7
0
 def should_not_parse_invalid_value(self, data):
     type, test_data = data
     BaseFilter.compile_regex({"name": "x", "params": [type]})
     f = BaseFilter("x(%s)" % test_data)
     expect(f.params).to_be_null()
Example #8
0
 def should_correctly_parse_value(self, data):
     type, test_data, expected_data = data
     BaseFilter.compile_regex({"name": "x", "params": [type]})
     f = BaseFilter("x(%s)" % test_data)
     expect(f.params[0]).to_equal(expected_data)
Example #9
0
 def test_with_invalid_values_should_correctly_parse_value(self):
     for params in FILTER_PARAMS_DATA:
         for test_data in params['invalid_values']:
             BaseFilter.compile_regex({'name': 'x', 'params': [params['type']]})
             f = BaseFilter('x(%s)' % test_data)
             expect(f.params).to_be_null()
Example #10
0
 def test_with_valid_values_should_correctly_parse_value(self):
     for params in FILTER_PARAMS_DATA:
         for test_data, expected_data in params["values"]:
             BaseFilter.compile_regex({"name": "x", "params": [params["type"]]})
             filter_instance = BaseFilter("x(%s)" % test_data)
             expect(filter_instance.params[0]).to_equal(expected_data)
Example #11
0
 def should_not_parse_invalid_value(self, data):
     type, test_data = data
     BaseFilter.compile_regex({'name': 'x', 'params': [type]})
     f = BaseFilter('x(%s)' % test_data)
     expect(f.params).to_be_null()
Example #12
0
 def should_correctly_parse_value(self, data):
     type, test_data, expected_data = data
     BaseFilter.compile_regex({'name': 'x', 'params': [type]})
     f = BaseFilter('x(%s)' % test_data)
     expect(f.params[0]).to_equal(expected_data)