Skip to content

Commit

Permalink
environ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov721 committed Dec 27, 2024
1 parent 82b3946 commit 0586734
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions luxonis_ml/utils/environ.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
from typing import Literal, Optional
from typing import Any, Dict, Literal, Optional

from pydantic import model_serializer
from pydantic_settings import BaseSettings, SettingsConfigDict
Expand Down Expand Up @@ -42,9 +42,9 @@ class Environ(BaseSettings):
"INFO"
)

@model_serializer(when_used="always", mode="plain", return_type=str)
def _serialize_environ(self) -> str:
return "{}"
@model_serializer(when_used="always", mode="plain")
def _serialize_environ(self) -> Dict[str, Any]:
return {}


environ = Environ()
5 changes: 5 additions & 0 deletions tests/test_utils/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import yaml
from pydantic import BaseModel

from luxonis_ml.utils import environ
from luxonis_ml.utils.config import LuxonisConfig

CONFIG_DATA = {
Expand Down Expand Up @@ -262,3 +263,7 @@ def test_get(config_file: str):

with pytest.raises(ValueError):
cfg.get("list_config.-1.int_list_param")


def test_environ():
assert environ.model_dump() == {}

0 comments on commit 0586734

Please sign in to comment.