Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfeaabb9

Browse files
Sumesh MuraliAshwin Rajeev
Sumesh Murali
authored and
Ashwin Rajeev
committed
added multiple tests for item_type validation
1 parent008c59a commitfeaabb9

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-
deftest_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+
deftest_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
withpytest.raises(exceptions.UnsupportedItemType):
119127
selectorlib.Extractor.from_yaml_string(yaml_string)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp