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()
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()
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)
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()
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()
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)
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()
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)
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()
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)