Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

test: data for unused and constant annotations #439

Merged
merged 5 commits into from
Apr 17, 2022
Merged
Show file tree
Hide file tree
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
118 changes: 118 additions & 0 deletions package-parser/tests/data/constant/api_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"distribution": "test",
"package": "test",
"version": "0.0.1",
"modules": [
{
"name": "test",
"imports": [],
"from_imports": [],
"classes": [],
"functions": [
"test.unused_global_function",
"test.commonly_used_global_function"
]
}
],
"classes": [],
"functions": [
{
"name": "unused_global_function",
"unique_name": "unused_global_function",
"qname": "test.unused_global_function",
"unique_qname": "test.unused_global_function",
"decorators": [],
"parameters": [
{
"name": "unused_required_parameter",
"default_value": null,
"is_public": true,
"assigned_by": "POSITION_OR_NAME",
"docstring": {
"type": "str",
"description": ""
}
},
{
"name": "unused_optional_parameter",
"default_value": "'bla'",
"is_public": true,
"assigned_by": "POSITION_OR_NAME",
"docstring": {
"type": "str",
"description": ""
}
}
],
"results": [],
"is_public": true,
"description": "",
"docstring": "",
"source_code": ""
},
{
"name": "commonly_used_global_function",
"unique_name": "commonly_used_global_function",
"qname": "test.commonly_used_global_function",
"unique_qname": "test.commonly_used_global_function",
"decorators": [],
"parameters": [
{
"name": "useless_required_parameter",
"default_value": null,
"is_public": true,
"assigned_by": "POSITION_OR_NAME",
"docstring": {
"type": "str",
"description": ""
}
},
{
"name": "useful_required_parameter",
"default_value": null,
"is_public": true,
"assigned_by": "POSITION_OR_NAME",
"docstring": {
"type": "str",
"description": ""
}
},
{
"name": "unused_optional_parameter",
"default_value": "'bla'",
"is_public": true,
"assigned_by": "POSITION_OR_NAME",
"docstring": {
"type": "str",
"description": ""
}
},
{
"name": "useless_optional_parameter",
"default_value": "'bla'",
"is_public": true,
"assigned_by": "POSITION_OR_NAME",
"docstring": {
"type": "str",
"description": ""
}
},
{
"name": "useful_optional_parameter",
"default_value": "'bla'",
"is_public": true,
"assigned_by": "POSITION_OR_NAME",
"docstring": {
"type": "str",
"description": ""
}
}
],
"results": [],
"is_public": true,
"description": "",
"docstring": "",
"source_code": ""
}
]
}
209 changes: 209 additions & 0 deletions package-parser/tests/data/constant/usage_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
{
"class_usages": {},
"function_usages": {
"test.unused_global_function": [],
"test.commonly_used_global_function": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
]
},
"parameter_usages": {
"test.unused_global_function.unused_required_parameter": [],
"test.unused_global_function.unused_optional_parameter": [],
"test.commonly_used_global_function.useless_required_parameter": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
],
"test.commonly_used_global_function.useful_required_parameter": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
],
"test.commonly_used_global_function.unused_optional_parameter": [],
"test.commonly_used_global_function.useless_optional_parameter": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
],
"test.commonly_used_global_function.useful_optional_parameter": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
]
},
"value_usages": {
"test.unused_global_function.unused_required_parameter": {},
"test.unused_global_function.unused_optional_parameter": {},
"test.commonly_used_global_function.useless_required_parameter": {
"'blup'": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
]
},
"test.commonly_used_global_function.useful_required_parameter": {
"'bla'": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
],
"'blup'": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
]
},
"test.commonly_used_global_function.unused_optional_parameter": {},
"test.commonly_used_global_function.useless_optional_parameter": {
"'bla'": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
]
},
"test.commonly_used_global_function.useful_optional_parameter": {
"'blup'": [
{
"file": "test.py",
"line": 1,
"column": 1
},
{
"file": "test.py",
"line": 1,
"column": 1
}
]
}
}
}
Loading