Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede committed Sep 17, 2024
1 parent 244378c commit 35d5fc2
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions test/test_config/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import pytest

from dxtb._src.constants import defaults, labels
from dxtb._src.exlibs.available import has_libcint
from dxtb._src.typing import get_default_device, get_default_dtype
from dxtb.config import Config as Cfg

Expand All @@ -36,7 +37,6 @@ def test_default() -> None:
assert cfg.batch_mode == defaults.BATCH_MODE

assert cfg.ints.cutoff == defaults.INTCUTOFF
assert cfg.ints.driver == defaults.INTDRIVER
assert cfg.ints.level == defaults.INTLEVEL
assert cfg.ints.uplo == defaults.INTUPLO

Expand Down Expand Up @@ -75,6 +75,11 @@ def test_default() -> None:

assert cfg.max_element == defaults.MAX_ELEMENT

if has_libcint is True:
assert cfg.ints.driver == defaults.INTDRIVER
else:
assert cfg.ints.driver == labels.INTDRIVER_ANALYTICAL


def test_method() -> None:
cfg = Cfg(method=labels.GFN1_XTB_STRS[0])
Expand All @@ -83,11 +88,18 @@ def test_method() -> None:
cfg = Cfg(method=labels.GFN1_XTB)
assert cfg.method == labels.GFN1_XTB

cfg = Cfg(method=labels.GFN2_XTB_STRS[0])
assert cfg.method == labels.GFN2_XTB
if has_libcint is True:
cfg = Cfg(method=labels.GFN2_XTB)
assert cfg.method == labels.GFN2_XTB

cfg = Cfg(method=labels.GFN2_XTB_STRS[0])
assert cfg.method == labels.GFN2_XTB
else:
with pytest.raises(RuntimeError):
Cfg(method=labels.GFN2_XTB_STRS[0])

cfg = Cfg(method=labels.GFN2_XTB)
assert cfg.method == labels.GFN2_XTB
with pytest.raises(RuntimeError):
Cfg(method=labels.GFN2_XTB)


def test_method_fail() -> None:
Expand Down

0 comments on commit 35d5fc2

Please sign in to comment.