Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/unit/rules/python/third_party/PyYAML/test_yaml_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ def test_incomplete_import_yaml_load(self):
results = self.parser.parse("test.py", str.encode(fdata))
self.assertEqual(0, len(results))

def test_import_in_func_yaml_load(self):
fdata = textwrap.dedent(
"""
def test_func():
import yaml
yaml.load("{}")
"""
)
results = self.parser.parse("test.py", str.encode(fdata))
# FIX(ericwb): false positive, shouldn't be able to find import due
# to scope.
self.assertEqual(1, len(results))

def test_yaml_load_positional_loader(self):
fdata = textwrap.dedent(
"""
Expand Down