sysnet-pyutils 1.7.6__tar.gz → 1.7.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/PKG-INFO +44 -6
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/README.md +43 -5
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/pyproject.toml +1 -1
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/__init__.py +4 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/models/general.py +15 -16
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils.egg-info/PKG-INFO +44 -6
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_models_general.py +12 -8
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/LICENSE +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/setup.cfg +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/barcode.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/constants.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/cron_utils/__init__.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/cron_utils/validation.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/data_utils.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/domino.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/geo.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/globalmodel/__init__.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/globalmodel/global_model.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/globalmodel/models.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/globalmodel/timeutils.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/ident.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/log.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/models/__init__.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/ses.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/syslog/__init__.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/syslog/factory.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/tools.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils/utils.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils.egg-info/SOURCES.txt +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils.egg-info/dependency_links.txt +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils.egg-info/not-zip-safe +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils.egg-info/requires.txt +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/sysnet_pyutils.egg-info/top_level.txt +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_cron_utils.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_cron_validation_edge.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_data_utils.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_data_utils_datetime.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_data_utils_edge.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_data_utils_missing_branches.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_domino.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_domino_edge.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_geo.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_global_model_recursive.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_global_model_timezone.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_ident_barcode.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_log_importerror_branch.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_log_mongo.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_models_contact.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_models_general_edge.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_package_init_version.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_recursive_update.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_ses.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_ses_importerror_branch.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_syslog_factory.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_tools.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_utils.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_utils_edge.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_utils_log_base64.py +0 -0
- {sysnet_pyutils-1.7.6 → sysnet_pyutils-1.7.8}/tests/test_utils_missing_branches.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sysnet-pyutils
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.8
|
|
4
4
|
Summary: SYSNET Python Utilities - kompletní sada nástrojů pro Python aplikace
|
|
5
5
|
Author-email: Data Developer <info@sysnet.cz>
|
|
6
6
|
Maintainer-email: SYSNET Development Team <info@sysnet.cz>
|
|
@@ -749,6 +749,7 @@ Knihovna obsahuje základní, v aplikacích hojně používané, utility pro Pyt
|
|
|
749
749
|
- [ses](#sespy)
|
|
750
750
|
- [syslog](#syslog)
|
|
751
751
|
- [models.general](#modelsgeneral)
|
|
752
|
+
- [Info/Health modely](#infohealth-modely)
|
|
752
753
|
- [Volitelné závislosti](#volitelné-závislosti)
|
|
753
754
|
- [Testování](#testování)
|
|
754
755
|
- [Vývoj](#vývoj)
|
|
@@ -1197,6 +1198,36 @@ print(str(log_item)) # "2023-05-15 10:00:00 [SYSTEM] Dokument autorizován"
|
|
|
1197
1198
|
|
|
1198
1199
|
---
|
|
1199
1200
|
|
|
1201
|
+
### Info/Health modely
|
|
1202
|
+
|
|
1203
|
+
Sjednocený formát pro sledování zdraví služby (health check).
|
|
1204
|
+
|
|
1205
|
+
```python
|
|
1206
|
+
from sysnet_pyutils.models.general import InfoType, InfoComponentType, InfoStatusEnum
|
|
1207
|
+
|
|
1208
|
+
info = InfoType(name="My Service", version="1.0.0")
|
|
1209
|
+
|
|
1210
|
+
# Přidání komponenty (např. MongoDB)
|
|
1211
|
+
info.components.append(InfoComponentType(
|
|
1212
|
+
code="mongo",
|
|
1213
|
+
status=InfoStatusEnum.GREEN,
|
|
1214
|
+
info="Connected to localhost:27017"
|
|
1215
|
+
))
|
|
1216
|
+
|
|
1217
|
+
# Přidání další komponenty s chybou
|
|
1218
|
+
info.components.append(InfoComponentType(
|
|
1219
|
+
code="storage",
|
|
1220
|
+
status=InfoStatusEnum.RED,
|
|
1221
|
+
info="Disk space low"
|
|
1222
|
+
))
|
|
1223
|
+
|
|
1224
|
+
# Automatický výpočet celkového statusu (RED > YELLOW > GREEN)
|
|
1225
|
+
info.update_status()
|
|
1226
|
+
print(info.status) # RED
|
|
1227
|
+
```
|
|
1228
|
+
|
|
1229
|
+
---
|
|
1230
|
+
|
|
1200
1231
|
## 🔌 Volitelné závislosti
|
|
1201
1232
|
|
|
1202
1233
|
| Extra | Balíčky | Použití |
|
|
@@ -1315,6 +1346,12 @@ pyutils/
|
|
|
1315
1346
|
|
|
1316
1347
|
## 📚 Changelog
|
|
1317
1348
|
|
|
1349
|
+
### Verze 1.7.6 (2026-06-19)
|
|
1350
|
+
|
|
1351
|
+
**Nové funkce:**
|
|
1352
|
+
- ✅ `models/general.py` — přidán `InfoType`, `InfoComponentType` a `InfoStatusEnum` pro sjednocené health checky napříč mikroslužbami (#9991)
|
|
1353
|
+
- ✅ `tests/test_models_general.py` — doplněny testy pro výpočet statusu v `InfoType`
|
|
1354
|
+
|
|
1318
1355
|
### Verze 1.7.5 (2026-04-07)
|
|
1319
1356
|
|
|
1320
1357
|
**Nové funkce:**
|
|
@@ -1422,8 +1459,9 @@ pyutils/
|
|
|
1422
1459
|
Tento projekt je licencován pod MIT licencí — viz [LICENSE](LICENSE) soubor.
|
|
1423
1460
|
|
|
1424
1461
|
---
|
|
1425
|
-
|
|
1426
|
-
**Vytvořeno s ❤️ týmem SYSNET**
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1462
|
+
|
|
1463
|
+
**Vytvořeno s ❤️ týmem SYSNET**
|
|
1464
|
+
|
|
1465
|
+
-*Verze: 1.7.6*
|
|
1466
|
+
+*Verze: 1.7.6*
|
|
1467
|
+
*Datum: 2026-06-19*
|
|
@@ -26,6 +26,7 @@ Knihovna obsahuje základní, v aplikacích hojně používané, utility pro Pyt
|
|
|
26
26
|
- [ses](#sespy)
|
|
27
27
|
- [syslog](#syslog)
|
|
28
28
|
- [models.general](#modelsgeneral)
|
|
29
|
+
- [Info/Health modely](#infohealth-modely)
|
|
29
30
|
- [Volitelné závislosti](#volitelné-závislosti)
|
|
30
31
|
- [Testování](#testování)
|
|
31
32
|
- [Vývoj](#vývoj)
|
|
@@ -474,6 +475,36 @@ print(str(log_item)) # "2023-05-15 10:00:00 [SYSTEM] Dokument autorizován"
|
|
|
474
475
|
|
|
475
476
|
---
|
|
476
477
|
|
|
478
|
+
### Info/Health modely
|
|
479
|
+
|
|
480
|
+
Sjednocený formát pro sledování zdraví služby (health check).
|
|
481
|
+
|
|
482
|
+
```python
|
|
483
|
+
from sysnet_pyutils.models.general import InfoType, InfoComponentType, InfoStatusEnum
|
|
484
|
+
|
|
485
|
+
info = InfoType(name="My Service", version="1.0.0")
|
|
486
|
+
|
|
487
|
+
# Přidání komponenty (např. MongoDB)
|
|
488
|
+
info.components.append(InfoComponentType(
|
|
489
|
+
code="mongo",
|
|
490
|
+
status=InfoStatusEnum.GREEN,
|
|
491
|
+
info="Connected to localhost:27017"
|
|
492
|
+
))
|
|
493
|
+
|
|
494
|
+
# Přidání další komponenty s chybou
|
|
495
|
+
info.components.append(InfoComponentType(
|
|
496
|
+
code="storage",
|
|
497
|
+
status=InfoStatusEnum.RED,
|
|
498
|
+
info="Disk space low"
|
|
499
|
+
))
|
|
500
|
+
|
|
501
|
+
# Automatický výpočet celkového statusu (RED > YELLOW > GREEN)
|
|
502
|
+
info.update_status()
|
|
503
|
+
print(info.status) # RED
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
---
|
|
507
|
+
|
|
477
508
|
## 🔌 Volitelné závislosti
|
|
478
509
|
|
|
479
510
|
| Extra | Balíčky | Použití |
|
|
@@ -592,6 +623,12 @@ pyutils/
|
|
|
592
623
|
|
|
593
624
|
## 📚 Changelog
|
|
594
625
|
|
|
626
|
+
### Verze 1.7.6 (2026-06-19)
|
|
627
|
+
|
|
628
|
+
**Nové funkce:**
|
|
629
|
+
- ✅ `models/general.py` — přidán `InfoType`, `InfoComponentType` a `InfoStatusEnum` pro sjednocené health checky napříč mikroslužbami (#9991)
|
|
630
|
+
- ✅ `tests/test_models_general.py` — doplněny testy pro výpočet statusu v `InfoType`
|
|
631
|
+
|
|
595
632
|
### Verze 1.7.5 (2026-04-07)
|
|
596
633
|
|
|
597
634
|
**Nové funkce:**
|
|
@@ -699,8 +736,9 @@ pyutils/
|
|
|
699
736
|
Tento projekt je licencován pod MIT licencí — viz [LICENSE](LICENSE) soubor.
|
|
700
737
|
|
|
701
738
|
---
|
|
702
|
-
|
|
703
|
-
**Vytvořeno s ❤️ týmem SYSNET**
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
739
|
+
|
|
740
|
+
**Vytvořeno s ❤️ týmem SYSNET**
|
|
741
|
+
|
|
742
|
+
-*Verze: 1.7.6*
|
|
743
|
+
+*Verze: 1.7.6*
|
|
744
|
+
*Datum: 2026-06-19*
|
|
@@ -93,6 +93,9 @@ from sysnet_pyutils.models.general import (
|
|
|
93
93
|
ErrorModel,
|
|
94
94
|
GeoPointJtskType,
|
|
95
95
|
GeoPointType,
|
|
96
|
+
InfoComponentType,
|
|
97
|
+
InfoStatusEnum,
|
|
98
|
+
InfoType,
|
|
96
99
|
LinkedType,
|
|
97
100
|
ListTypeBase,
|
|
98
101
|
LocationType,
|
|
@@ -111,6 +114,7 @@ from sysnet_pyutils.models.general import (
|
|
|
111
114
|
TimeLimitedType,
|
|
112
115
|
UserType,
|
|
113
116
|
WorkflowType,
|
|
117
|
+
calculate_status,
|
|
114
118
|
)
|
|
115
119
|
|
|
116
120
|
# Syslog
|
|
@@ -468,28 +468,27 @@ class InfoStatusEnum(BaseEnum):
|
|
|
468
468
|
RED = "RED"
|
|
469
469
|
|
|
470
470
|
|
|
471
|
+
def calculate_status(statuses: List[InfoStatusEnum]) -> InfoStatusEnum:
|
|
472
|
+
"""Vypočítá celkový stav na základě seznamu stavů (RED > YELLOW > GREEN)."""
|
|
473
|
+
if not statuses:
|
|
474
|
+
return InfoStatusEnum.GREEN
|
|
475
|
+
if InfoStatusEnum.RED in statuses:
|
|
476
|
+
return InfoStatusEnum.RED
|
|
477
|
+
if InfoStatusEnum.YELLOW in statuses:
|
|
478
|
+
return InfoStatusEnum.YELLOW
|
|
479
|
+
return InfoStatusEnum.GREEN
|
|
480
|
+
|
|
481
|
+
|
|
471
482
|
class InfoComponentType(BaseModel):
|
|
472
|
-
|
|
483
|
+
name: str = Field(..., description="Název komponenty (např. mongo-db, storage)")
|
|
473
484
|
status: InfoStatusEnum = Field(..., description="Stav komponenty")
|
|
474
|
-
|
|
485
|
+
message: Optional[str] = Field(default=None, description="Detailní zpráva o stavu")
|
|
475
486
|
|
|
476
487
|
|
|
477
488
|
class InfoType(BaseModel):
|
|
478
|
-
status: InfoStatusEnum = Field(default=InfoStatusEnum.GREEN, description="Celkový stav služby")
|
|
479
489
|
name: str = Field(..., description="Název služby")
|
|
480
490
|
version: str = Field(..., description="Verze služby")
|
|
491
|
+
status: InfoStatusEnum = Field(default=InfoStatusEnum.GREEN, description="Celkový stav služby")
|
|
492
|
+
timestamp: datetime = Field(default_factory=datetime.now, description="Čas vygenerování reportu")
|
|
481
493
|
components: List[InfoComponentType] = Field(default_factory=list, description="Seznam komponent")
|
|
482
494
|
|
|
483
|
-
def update_status(self):
|
|
484
|
-
"""Aktualizuje celkový status na základě nejhoršího stavu komponent."""
|
|
485
|
-
if not self.components:
|
|
486
|
-
self.status = InfoStatusEnum.GREEN
|
|
487
|
-
return self.status
|
|
488
|
-
statuses = [c.status for c in self.components]
|
|
489
|
-
if InfoStatusEnum.RED in statuses:
|
|
490
|
-
self.status = InfoStatusEnum.RED
|
|
491
|
-
elif InfoStatusEnum.YELLOW in statuses:
|
|
492
|
-
self.status = InfoStatusEnum.YELLOW
|
|
493
|
-
else:
|
|
494
|
-
self.status = InfoStatusEnum.GREEN
|
|
495
|
-
return self.status
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sysnet-pyutils
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.8
|
|
4
4
|
Summary: SYSNET Python Utilities - kompletní sada nástrojů pro Python aplikace
|
|
5
5
|
Author-email: Data Developer <info@sysnet.cz>
|
|
6
6
|
Maintainer-email: SYSNET Development Team <info@sysnet.cz>
|
|
@@ -749,6 +749,7 @@ Knihovna obsahuje základní, v aplikacích hojně používané, utility pro Pyt
|
|
|
749
749
|
- [ses](#sespy)
|
|
750
750
|
- [syslog](#syslog)
|
|
751
751
|
- [models.general](#modelsgeneral)
|
|
752
|
+
- [Info/Health modely](#infohealth-modely)
|
|
752
753
|
- [Volitelné závislosti](#volitelné-závislosti)
|
|
753
754
|
- [Testování](#testování)
|
|
754
755
|
- [Vývoj](#vývoj)
|
|
@@ -1197,6 +1198,36 @@ print(str(log_item)) # "2023-05-15 10:00:00 [SYSTEM] Dokument autorizován"
|
|
|
1197
1198
|
|
|
1198
1199
|
---
|
|
1199
1200
|
|
|
1201
|
+
### Info/Health modely
|
|
1202
|
+
|
|
1203
|
+
Sjednocený formát pro sledování zdraví služby (health check).
|
|
1204
|
+
|
|
1205
|
+
```python
|
|
1206
|
+
from sysnet_pyutils.models.general import InfoType, InfoComponentType, InfoStatusEnum
|
|
1207
|
+
|
|
1208
|
+
info = InfoType(name="My Service", version="1.0.0")
|
|
1209
|
+
|
|
1210
|
+
# Přidání komponenty (např. MongoDB)
|
|
1211
|
+
info.components.append(InfoComponentType(
|
|
1212
|
+
code="mongo",
|
|
1213
|
+
status=InfoStatusEnum.GREEN,
|
|
1214
|
+
info="Connected to localhost:27017"
|
|
1215
|
+
))
|
|
1216
|
+
|
|
1217
|
+
# Přidání další komponenty s chybou
|
|
1218
|
+
info.components.append(InfoComponentType(
|
|
1219
|
+
code="storage",
|
|
1220
|
+
status=InfoStatusEnum.RED,
|
|
1221
|
+
info="Disk space low"
|
|
1222
|
+
))
|
|
1223
|
+
|
|
1224
|
+
# Automatický výpočet celkového statusu (RED > YELLOW > GREEN)
|
|
1225
|
+
info.update_status()
|
|
1226
|
+
print(info.status) # RED
|
|
1227
|
+
```
|
|
1228
|
+
|
|
1229
|
+
---
|
|
1230
|
+
|
|
1200
1231
|
## 🔌 Volitelné závislosti
|
|
1201
1232
|
|
|
1202
1233
|
| Extra | Balíčky | Použití |
|
|
@@ -1315,6 +1346,12 @@ pyutils/
|
|
|
1315
1346
|
|
|
1316
1347
|
## 📚 Changelog
|
|
1317
1348
|
|
|
1349
|
+
### Verze 1.7.6 (2026-06-19)
|
|
1350
|
+
|
|
1351
|
+
**Nové funkce:**
|
|
1352
|
+
- ✅ `models/general.py` — přidán `InfoType`, `InfoComponentType` a `InfoStatusEnum` pro sjednocené health checky napříč mikroslužbami (#9991)
|
|
1353
|
+
- ✅ `tests/test_models_general.py` — doplněny testy pro výpočet statusu v `InfoType`
|
|
1354
|
+
|
|
1318
1355
|
### Verze 1.7.5 (2026-04-07)
|
|
1319
1356
|
|
|
1320
1357
|
**Nové funkce:**
|
|
@@ -1422,8 +1459,9 @@ pyutils/
|
|
|
1422
1459
|
Tento projekt je licencován pod MIT licencí — viz [LICENSE](LICENSE) soubor.
|
|
1423
1460
|
|
|
1424
1461
|
---
|
|
1425
|
-
|
|
1426
|
-
**Vytvořeno s ❤️ týmem SYSNET**
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1462
|
+
|
|
1463
|
+
**Vytvořeno s ❤️ týmem SYSNET**
|
|
1464
|
+
|
|
1465
|
+
-*Verze: 1.7.6*
|
|
1466
|
+
+*Verze: 1.7.6*
|
|
1467
|
+
*Datum: 2026-06-19*
|
|
@@ -208,20 +208,24 @@ class TestIntegration:
|
|
|
208
208
|
assert metadata.contributor.name == "Jan Novák"
|
|
209
209
|
|
|
210
210
|
def test_info_type_status_calculation():
|
|
211
|
-
from sysnet_pyutils.models.general import InfoType, InfoComponentType, InfoStatusEnum
|
|
211
|
+
from sysnet_pyutils.models.general import InfoType, InfoComponentType, InfoStatusEnum, calculate_status
|
|
212
212
|
|
|
213
213
|
info = InfoType(name="Test Service", version="1.0.0")
|
|
214
214
|
assert info.status == InfoStatusEnum.GREEN
|
|
215
215
|
|
|
216
|
-
info.components.append(InfoComponentType(
|
|
217
|
-
|
|
216
|
+
info.components.append(InfoComponentType(name="mongo", status=InfoStatusEnum.GREEN))
|
|
217
|
+
info.status = calculate_status([c.status for c in info.components])
|
|
218
|
+
assert info.status == InfoStatusEnum.GREEN
|
|
218
219
|
|
|
219
|
-
info.components.append(InfoComponentType(
|
|
220
|
-
|
|
220
|
+
info.components.append(InfoComponentType(name="redis", status=InfoStatusEnum.YELLOW))
|
|
221
|
+
info.status = calculate_status([c.status for c in info.components])
|
|
222
|
+
assert info.status == InfoStatusEnum.YELLOW
|
|
221
223
|
|
|
222
|
-
info.components.append(InfoComponentType(
|
|
223
|
-
|
|
224
|
+
info.components.append(InfoComponentType(name="storage", status=InfoStatusEnum.RED))
|
|
225
|
+
info.status = calculate_status([c.status for c in info.components])
|
|
226
|
+
assert info.status == InfoStatusEnum.RED
|
|
224
227
|
|
|
225
228
|
# Odebrání RED komponenty by mělo vrátit YELLOW
|
|
226
229
|
info.components = [c for c in info.components if c.status != InfoStatusEnum.RED]
|
|
227
|
-
|
|
230
|
+
info.status = calculate_status([c.status for c in info.components])
|
|
231
|
+
assert info.status == InfoStatusEnum.YELLOW
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|