-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # CHANGELOG.md
- Loading branch information
Showing
25 changed files
with
505 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: PyTest | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
PyTest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements_dev.txt && pip install pytest-md | ||
|
||
- name: Run pytest | ||
uses: pavelzw/pytest-action@v2 | ||
with: | ||
verbose: true | ||
emoji: false | ||
job-summary: true | ||
custom-arguments: '-q' | ||
click-to-expand: true | ||
report-title: 'Test Report' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
import logging | ||
from enum import Enum | ||
|
||
from pydantic import BaseModel, ConfigDict, model_validator | ||
|
||
|
||
class OnOffEnum(str, Enum): | ||
ON = "ON" | ||
OFF = "OFF" | ||
|
||
|
||
class TDMBaseModel(BaseModel): | ||
model_config = ConfigDict(extra="allow") | ||
|
||
@model_validator(mode="after") | ||
def log_extra_fields(cls, values): | ||
if cls.__name__ != "StatusSNSSchema" and values.model_extra: | ||
logging.warning("%s has extra fields: %s", cls.__name__, values.model_extra) | ||
return values |
Oops, something went wrong.