Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LSO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
LSO
Commits
4fe7813c
Commit
4fe7813c
authored
1 year ago
by
geant-release-service
Browse files
Options
Downloads
Plain Diff
Finished release 1.5.
parents
0e15f35e
e66bf5e9
No related branches found
No related tags found
No related merge requests found
Changes
42
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/test_config.py
+0
-31
0 additions, 31 deletions
test/test_config.py
tox.ini
+0
-20
0 additions, 20 deletions
tox.ini
with
0 additions
and
51 deletions
test/test_config.py
deleted
100644 → 0
+
0
−
31
View file @
0e15f35e
"""
Set of tests that verify correct config is accepted and incorrect config is not.
"""
import
json
import
os
import
tempfile
from
pathlib
import
Path
import
jsonschema
import
pytest
from
lso
import
config
def
test_validate_testenv_config
(
data_config_filename
:
str
)
->
None
:
"""
Load a configuration from a file.
:param data_config_filename: Configuration file pytest fixture
"""
os
.
environ
[
"
SETTINGS_FILENAME
"
]
=
data_config_filename
params
=
config
.
load
()
assert
params
@pytest.mark.parametrize
(
"
bad_config
"
,
[{
"
name
"
:
"
bad version
"
,
"
version
"
:
123
},
{
"
name
"
:
"
missing version
"
},
{
"
version
"
:
"
missing name
"
}]
)
def
test_bad_config
(
bad_config
:
dict
)
->
None
:
with
tempfile
.
NamedTemporaryFile
(
mode
=
"
w
"
)
as
file
:
Path
(
file
.
name
).
write_text
(
json
.
dumps
(
bad_config
))
with
pytest
.
raises
(
jsonschema
.
ValidationError
):
config
.
load_from_file
(
Path
(
file
.
name
))
This diff is collapsed.
Click to expand it.
tox.ini
deleted
100644 → 0
+
0
−
20
View file @
0e15f35e
[tox]
envlist
=
py311
[testenv]
passenv
=
XDG_CACHE_HOME,USE_COMPOSE
setenv
=
SETTINGS_FILENAME
=
dummy.json
deps
=
coverage
-r
requirements.txt
commands
=
ruff
--respect-gitignore
--preview
.
ruff
format
--respect-gitignore
--preview
--check
.
mypy
.
coverage
erase
coverage
run
--source
lso
-m
pytest
coverage
xml
coverage
html
coverage
report
--fail-under
80
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment