Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
aisbf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
aisbf
Commits
4130d241
Commit
4130d241
authored
May 10, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test(license): relax Studio Python header assertions
parent
48892294
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
23 deletions
+36
-23
test_license_headers.py
tests/test_license_headers.py
+36
-23
No files found.
tests/test_license_headers.py
View file @
4130d241
from
pathlib
import
Path
from
pathlib
import
Path
PYTHON_LICENSE_HEADER
=
[
TASK_1_STUDIO_PYTHON_TARGETS
=
(
'"""'
,
Path
(
"aisbf/studio.py"
),
Path
(
"tests/test_studio.py"
),
Path
(
"tests/routes/test_dashboard_studio.py"
),
)
EXPECTED_TASK_1_STUDIO_PYTHON_TARGETS
=
(
Path
(
"aisbf/studio.py"
),
Path
(
"tests/test_studio.py"
),
Path
(
"tests/routes/test_dashboard_studio.py"
),
)
EXPECTED_HEADER_SNIPPETS
=
(
'Copyright (C) 2026 Stefy Lanza <stefy@nexlab.net>'
,
'Copyright (C) 2026 Stefy Lanza <stefy@nexlab.net>'
,
''
,
'AISBF - AI Service Broker Framework || AI Should Be Free'
,
'AISBF - AI Service Broker Framework || AI Should Be Free'
,
''
,
'This program is free software: you can redistribute it and/or modify'
,
'This program is free software: you can redistribute it and/or modify'
,
'it under the terms of the GNU General Public License as published by'
,
'it under the terms of the GNU General Public License as published by'
,
'the Free Software Foundation, either version 3 of the License, or'
,
'(at your option) any later version.'
,
''
,
'This program is distributed in the hope that it will be useful,'
,
'This program is distributed in the hope that it will be useful,'
,
'but WITHOUT ANY WARRANTY; without even the implied warranty of'
,
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'
,
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the'
,
'GNU General Public License for more details.'
,
'GNU General Public License for more details.'
,
''
,
'You should have received a copy of the GNU General Public License'
,
'You should have received a copy of the GNU General Public License'
,
'along with this program. If not, see <https://www.gnu.org/licenses/>.'
,
)
'"""'
,
]
def
_read_top_level_docstring
(
path
:
Path
)
->
str
:
content
=
path
.
read_text
(
encoding
=
"utf-8"
)
assert
content
.
startswith
(
'"""'
),
path
.
as_posix
()
closing_index
=
content
.
find
(
'"""'
,
3
)
assert
closing_index
!=
-
1
,
path
.
as_posix
()
return
content
[
3
:
closing_index
]
def
test_target_studio_python_files_use_standard_aisbf_license_header
():
def
test_task_1_header_test_targets_only_the_planned_studio_python_files
():
assert
TASK_1_STUDIO_PYTHON_TARGETS
==
EXPECTED_TASK_1_STUDIO_PYTHON_TARGETS
def
test_task_1_studio_python_files_use_aisbf_gpl_docstring_header_convention
():
repo_root
=
Path
(
__file__
)
.
resolve
()
.
parents
[
1
]
repo_root
=
Path
(
__file__
)
.
resolve
()
.
parents
[
1
]
target_files
=
[
repo_root
/
'aisbf'
/
'studio.py'
,
for
relative_path
in
TASK_1_STUDIO_PYTHON_TARGETS
:
repo_root
/
'tests'
/
'test_studio.py'
,
header
=
_read_top_level_docstring
(
repo_root
/
relative_path
)
repo_root
/
'tests'
/
'routes'
/
'test_dashboard_studio.py'
,
assert
header
.
startswith
(
'
\n
'
),
relative_path
.
as_posix
()
]
for
snippet
in
EXPECTED_HEADER_SNIPPETS
:
assert
snippet
in
header
,
f
"{relative_path.as_posix()}: missing {snippet!r}"
for
path
in
target_files
:
lines
=
path
.
read_text
(
encoding
=
'utf-8'
)
.
splitlines
()
assert
lines
[:
len
(
PYTHON_LICENSE_HEADER
)]
==
PYTHON_LICENSE_HEADER
,
path
.
as_posix
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment