2.1.0 (#317)
Co-authored-by: Quentin Torroba <quentin.torroba@mistral.ai> Co-authored-by: Michel Thomazo <michel.thomazo@mistral.ai> Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Vincent Guilloux <vincent.guilloux@mistral.ai> Co-authored-by: Clément Siriex <clement.sirieix@mistral.ai> Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai> Co-authored-by: Nicolas Karolak <nicolas@karolak.fr>
This commit is contained in:
parent
9809cfc831
commit
51fecc67d9
176 changed files with 8652 additions and 4451 deletions
|
|
@ -1,6 +1,8 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
import threading
|
||||
|
||||
from vibe.core.config import load_dotenv_values
|
||||
|
||||
|
|
@ -59,3 +61,21 @@ def test_ignores_empty_values(tmp_path: Path) -> None:
|
|||
assert "EMPTY" not in environ
|
||||
assert "MISTRAL_API_KEY" not in environ
|
||||
assert "NO_VALUE" not in environ
|
||||
|
||||
|
||||
def test_reads_from_fifo(tmp_path: Path) -> None:
|
||||
fifo_path = tmp_path / ".env.fifo"
|
||||
os.mkfifo(fifo_path)
|
||||
environ: dict[str, str] = {}
|
||||
|
||||
def write_to_fifo() -> None:
|
||||
with open(fifo_path, "w") as f:
|
||||
f.write("FIFO_KEY=fifo-value\n")
|
||||
|
||||
writer = threading.Thread(target=write_to_fifo)
|
||||
writer.start()
|
||||
|
||||
load_dotenv_values(env_path=fifo_path, environ=environ)
|
||||
|
||||
writer.join()
|
||||
assert environ["FIFO_KEY"] == "fifo-value"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue