Skip to content

Commit

Permalink
full coverage for config
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranquility2 committed Aug 24, 2024
1 parent 8b7b487 commit 96487be
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion core/tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
from testcontainers.core.config import TestcontainersConfiguration as TCC, _WARNINGS
from testcontainers.core.config import TestcontainersConfiguration as TCC, TC_FILE

from pytest import MonkeyPatch, mark, LogCaptureFixture

import logging
import tempfile


def test_read_tc_properties(monkeypatch: MonkeyPatch) -> None:
with tempfile.TemporaryDirectory() as tmpdirname:
file = f"{tmpdirname}/{TC_FILE}"
with open(file, "w") as f:
f.write("tc.host=some_value\n")

monkeypatch.setattr("testcontainers.core.config.TC_GLOBAL", file)

config = TCC()
assert config.tc_properties == {"tc.host": "some_value"}


@mark.parametrize("docker_auth_config_env", ["key=value", ""])
Expand Down

0 comments on commit 96487be

Please sign in to comment.