This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
generated from ethho/poetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
87 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,7 @@ class Config: | |
"""Config class for the application""" | ||
|
||
allow_eval: bool = True | ||
debug: bool = True | ||
|
||
|
||
config = Config() |
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,14 +1,21 @@ | ||
from dataclasses import dataclass | ||
from typing import Dict, Any | ||
from dataclasses import dataclass, field | ||
from typing import Dict, Any, Optional | ||
import cerberus | ||
|
||
|
||
@dataclass | ||
class ValidationResult: | ||
status: bool | ||
# TODO | ||
errors: Any | ||
message: Any | ||
context: Optional[Dict[str, Any]] = field(default_factory=dict) | ||
|
||
@classmethod | ||
def from_validator(cls, v: cerberus.Validator): | ||
return cls(status=v.status, errors=v.errors) | ||
|
||
def __repr__(self): | ||
return f"ValidationResult(status={self.status}, message={self.message})" | ||
|
||
def __bool__(self) -> bool: | ||
return self.status |
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 |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
import datajoint_file_validator as djfval | ||
|
||
|
||
def test_glob_query(snapshot): | ||
def test_glob_query(): | ||
pass |