FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
RainingKeysPython/.github/scripts/config_validation.py at master · Ian-bug/RainingKeysPython · GitHub
Ian-bug
/
RainingKeysPython
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
RainingKeysPython
/
.github
/
scripts
/
config_validation.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
54 lines (43 loc) · 1.56 KB
Breadcrumbs
RainingKeysPython
/
.github
/
scripts
/
config_validation.py
Copy path
File metadata and controls
54 lines (43 loc) · 1.56 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
"""Configuration validation script for GitHub Actions CI."""
import
sys
import
os
# Get repository root (2 levels up from this script)
repo_root
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
print
(
f"Repository root:
{
repo_root
}
"
)
# Add repository root to Python path
sys
.
path
.
insert
(
0
,
repo_root
)
# Suppress Qt warnings for CI
os
.
environ
[
'QT_QPA_PLATFORM'
]
=
'offscreen'
def
validate_config
():
"""Validate configuration schema and operations."""
try
:
from
core
.
settings_manager
import
SettingsManager
from
core
.
configuration
import
AppConfig
print
(
"Testing configuration validation..."
)
# Test default config
config
=
AppConfig
()
print
(
"[OK] Default configuration created successfully"
)
# Test schema validation
settings
=
SettingsManager
()
print
(
"[OK] Schema validation passed"
)
# Test config save
import
tempfile
temp_config
=
tempfile
.
mktemp
(
suffix
=
'.ini'
)
try
:
settings
.
filename
=
temp_config
settings
.
save
()
print
(
"[OK] Config save works correctly"
)
finally
:
if
os
.
path
.
exists
(
temp_config
):
os
.
remove
(
temp_config
)
print
(
"
\n
All configuration validation checks passed!"
)
return
True
except
Exception
as
e
:
print
(
f"[ERROR] Configuration validation failed:
{
e
}
"
)
import
traceback
traceback
.
print_exc
()
return
False
if
__name__
==
"__main__"
:
if
not
validate_config
():
sys
.
exit
(
1
)
Back
|
FazBrowse Home
|
New Git URL