Skip to content

Commit feaabb9

Browse files
Sumesh MuraliAshwin Rajeev
authored andcommitted
added multiple tests for item_type validation
1 parent 008c59a commit feaabb9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/test_selectorlib.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,18 @@ def test_extract_field_supported_item_types(
110110
}
111111

112112

113-
def test_extract_field_unsupported_item_types():
114-
yaml_string = """test_text:
113+
@pytest.mark.parametrize("unsupported_item_type", [
114+
"text",
115+
"html",
116+
"link",
117+
"image",
118+
"attribute",
119+
"test_item_type"
120+
])
121+
def test_extract_field_unsupported_item_types(unsupported_item_type):
122+
yaml_string = f"""test_text:
115123
css: null
116124
xpath: '//p'
117-
type: text"""
125+
type: {unsupported_item_type}"""
118126
with pytest.raises(exceptions.UnsupportedItemType):
119127
selectorlib.Extractor.from_yaml_string(yaml_string)

0 commit comments

Comments
 (0)