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

Commit

Permalink
test: data for unused and constant annotations (#439)
Browse files Browse the repository at this point in the history
* test: api data for unused annotations

* test: usage data for unused annotations

* test: api data for constant annotations

* test: usage data for constant annotations

* refactor: rename files to prevent mapping to incorrect schema
  • Loading branch information
lars-reimann committed Apr 17, 2022
1 parent 43ced52 commit 15f530c
Show file tree
Hide file tree
Showing 4 changed files with 569 additions and 0 deletions.
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
}
]
}
}
}

0 comments on commit 15f530c

Please sign in to comment.