-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for CADET paths and CADET Runner attributes
- Loading branch information
1 parent
ffd32c4
commit 4a190fb
Showing
3 changed files
with
56 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from pathlib import Path | ||
|
||
from cadet import Cadet | ||
|
||
|
||
# Full path to cadet.dll or cadet.so, that is different from the system/conda cadet | ||
full_path_dll = Path(r"C:\Users\ronal\Documents\CADET\out\install\aRELEASE\bin\cadet.dll") | ||
|
||
install_path_conda = Cadet.autodetect_cadet() | ||
|
||
|
||
def test_meta_class(): | ||
Cadet.cadet_path = full_path_dll | ||
assert Cadet.use_dll | ||
|
||
# With a path set in the meta class, the sim instance should not autodetect and use the meta class cadet path | ||
sim = Cadet() | ||
assert sim.use_dll | ||
assert sim.install_path == full_path_dll.parent.parent | ||
assert sim.cadet_dll_path == full_path_dll | ||
assert sim.cadet_cli_path.parent == full_path_dll.parent | ||
|
||
# With an install path given, the sim instance should use the given install path | ||
sim = Cadet(install_path=install_path_conda) | ||
assert sim.install_path == install_path_conda | ||
assert sim.cadet_dll_path.parent.parent == install_path_conda | ||
assert sim.cadet_cli_path.parent.parent == install_path_conda |