-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathtest_config.py
More file actions
21 lines (15 loc) · 841 Bytes
/
Copy pathtest_config.py
File metadata and controls
21 lines (15 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from __future__ import annotations
import pytest
from felderize.config import Config
class TestAutoDownloadCompilerFlag:
def test_defaults_to_enabled(self, monkeypatch):
monkeypatch.delenv("FELDERIZE_AUTO_DOWNLOAD", raising=False)
assert Config.from_env().auto_download_compiler is True
@pytest.mark.parametrize("value", ["0", "false", "FALSE", "no", "off", "Off"])
def test_disabled_values(self, monkeypatch, value):
monkeypatch.setenv("FELDERIZE_AUTO_DOWNLOAD", value)
assert Config.from_env().auto_download_compiler is False
@pytest.mark.parametrize("value", ["1", "true", "yes", "on", "anything-else"])
def test_enabled_values(self, monkeypatch, value):
monkeypatch.setenv("FELDERIZE_AUTO_DOWNLOAD", value)
assert Config.from_env().auto_download_compiler is True