| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import pytest |
||
| 2 | from pocketutils.core.dot_dict import NestedDotDict |
||
| 3 | |||
| 4 | from mandos.model.settings import Settings |
||
| 5 | |||
| 6 | from .. import get_test_resource |
||
| 7 | |||
| 8 | |||
| 9 | class TestSettings: |
||
| 10 | def test_settings(self): |
||
| 11 | toml = NestedDotDict.read_toml(get_test_resource("settings.toml")) |
||
| 12 | x = Settings.load(toml) |
||
| 13 | assert x.taxon == 1111 |
||
| 14 | assert x.min_pchembl == 15 |
||
| 15 | assert x.min_confidence_score == 2 |
||
| 16 | assert x.min_phase == 0 |
||
| 17 | assert str(x.chembl_cache_path) == "~" |
||
| 18 | assert x.n_retries == 100 |
||
| 19 | assert not x.fast_save |
||
| 20 | assert x.timeout_sec == 0 |
||
| 21 | |||
| 22 | def test_empty(self): |
||
| 23 | toml = NestedDotDict.read_toml(get_test_resource("settings-empty.toml")) |
||
| 24 | x = Settings.load(toml) |
||
| 25 | assert x.min_phase == 3 |
||
| 26 | |||
| 27 | |||
| 28 | if __name__ == "__main__": |
||
| 29 | pytest.main() |
||
| 30 |