Skip to content

Commit c7c01ae

Browse files
committed
fix
1 parent d170e35 commit c7c01ae

4 files changed

Lines changed: 39 additions & 15 deletions

File tree

docs/examples/ca_api_example_basic.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
{
5454
"data": {
5555
"text/plain": [
56-
"{'python_version': '3.14.3', 'python_implementation': 'CPython'}"
56+
"{'python_version': '3.14.4', 'python_implementation': 'CPython'}"
5757
]
5858
},
5959
"execution_count": 2,
@@ -86,7 +86,7 @@
8686
"metadata": {},
8787
"outputs": [],
8888
"source": [
89-
"from codeaudit.api_interfaces import version_info"
89+
"from codeaudit.api_interfaces import version"
9090
]
9191
},
9292
{
@@ -98,7 +98,7 @@
9898
{
9999
"data": {
100100
"text/plain": [
101-
"{'name': 'Python_Code_Audit', 'version': '1.6.3.dev39+ga990bb23a.d20260411'}"
101+
"{'name': 'Python_Code_Audit', 'version': '1.6.5rc2'}"
102102
]
103103
},
104104
"execution_count": 4,
@@ -107,7 +107,7 @@
107107
}
108108
],
109109
"source": [
110-
"version_info()"
110+
"version()"
111111
]
112112
},
113113
{
@@ -184,8 +184,8 @@
184184
"data": {
185185
"text/plain": [
186186
"{'name': 'Python_Code_Audit',\n",
187-
" 'version': '1.6.3.dev39+ga990bb23a.d20260411',\n",
188-
" 'generated_on': '2026-04-11 13:56',\n",
187+
" 'version': '1.6.5rc2',\n",
188+
" 'generated_on': '2026-04-21 21:53',\n",
189189
" 'pandas_vulnerability_info': [{'id': 'PYSEC-2020-73',\n",
190190
" 'summary': '',\n",
191191
" 'details': \"** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an untrusted file that is passed to the read_pickle() function, if __reduce__ makes an os.system call. NOTE: third parties dispute this issue because the read_pickle() function is documented as unsafe and it is the user's responsibility to use the function in a secure manner.\",\n",
@@ -240,8 +240,8 @@
240240
"data": {
241241
"text/plain": [
242242
"{'name': 'Python_Code_Audit',\n",
243-
" 'version': '1.6.3.dev39+ga990bb23a.d20260411',\n",
244-
" 'generated_on': '2026-04-11 13:56',\n",
243+
" 'version': '1.6.5rc2',\n",
244+
" 'generated_on': '2026-04-21 21:53',\n",
245245
" 'requests_vulnerability_info': [{'id': 'GHSA-652x-xj99-gmcc',\n",
246246
" 'summary': 'Exposure of Sensitive Information to an Unauthorized Actor in Requests',\n",
247247
" 'details': 'Requests (aka python-requests) before 2.3.0 allows remote servers to obtain sensitive information by reading the Proxy-Authorization header in a redirected request.',\n",
@@ -355,8 +355,8 @@
355355
"data": {
356356
"text/plain": [
357357
"{'name': 'Python_Code_Audit',\n",
358-
" 'version': '1.6.3.dev39+ga990bb23a.d20260411',\n",
359-
" 'generated_on': '2026-04-11 13:56',\n",
358+
" 'version': '1.6.5rc2',\n",
359+
" 'generated_on': '2026-04-21 21:53',\n",
360360
" 'validations': [{'name': 'Assertions',\n",
361361
" 'construct': 'assert',\n",
362362
" 'severity': 'Low',\n",
@@ -717,7 +717,7 @@
717717
"name": "python",
718718
"nbconvert_exporter": "python",
719719
"pygments_lexer": "ipython3",
720-
"version": "3.14.3"
720+
"version": "3.14.4"
721721
}
722722
},
723723
"nbformat": 4,

docs/examples/demoscan.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Python_Code_Audit",
3-
"version": "1.6.3.dev39+ga990bb23a.d20260411",
4-
"generated_on": "2026-04-20 17:37",
3+
"version": "1.6.5rc2",
4+
"generated_on": "2026-04-21 21:54",
55
"file_security_info": {
66
"0": {
77
"FileName": "demofile.py",

src/codeaudit/api_interfaces.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ def filescan(input_path, nosec=False):
114114
"""
115115
file_output = {}
116116
file_path = Path(input_path)
117-
ca_version_info = version_info()
117+
ca_version_info = {"name": "Python_Code_Audit", "version": __version__}
118+
118119
now = datetime.datetime.now()
119120
timestamp_str = now.strftime("%Y-%m-%d %H:%M")
120121
output = ca_version_info | {"generated_on": timestamp_str}
@@ -404,7 +405,7 @@ def get_default_validations():
404405

405406
def _generation_info():
406407
"""Internal function to retrieve generation info for APIs output"""
407-
ca_version_info = version_info()
408+
ca_version_info = {"name": "Python_Code_Audit", "version": __version__}
408409
now = datetime.datetime.now()
409410
timestamp_str = now.strftime("%Y-%m-%d %H:%M")
410411
output = ca_version_info | {"generated_on": timestamp_str}

tests/test_apicalls2.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-FileCopyrightText: 2025-present Maikel Mardjan(https://nocomplexity.com/) and all contributors!
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
import pytest
6+
7+
from codeaudit.api_interfaces import _generation_info
8+
9+
10+
11+
def test_generation_info_simple():
12+
result = _generation_info()
13+
14+
# Check that the constant 'name' is correct
15+
assert result["name"] == "Python_Code_Audit"
16+
17+
# Check that all required keys are present
18+
assert "version" in result
19+
assert "generated_on" in result
20+
21+
# Verify the output has exactly 3 items
22+
assert len(result) == 3
23+

0 commit comments

Comments
 (0)