Skip to content

Commit 4d70e15

Browse files
committed
add individual test files for each example dir
1 parent 0ef05db commit 4d70e15

File tree

6 files changed

+96
-0
lines changed

6 files changed

+96
-0
lines changed

tests/test_ch03.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
from conftest import __examples_dir__, run_cmi_script
5+
6+
7+
@pytest.mark.parametrize(
8+
"relative_path",
9+
[
10+
f"{__examples_dir__}/ch03NiModelling"
11+
+ "/solutions/diffpy-cmi/fitBulkNi.py",
12+
f"{__examples_dir__}/ch03NiModelling"
13+
+ "/solutions/diffpy-cmi/fitNPPt.py",
14+
],
15+
)
16+
def test_ch03_examples(relative_path):
17+
script_path = Path(__file__).parent.parent / relative_path
18+
run_cmi_script(script_path)

tests/test_ch05.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
from conftest import __examples_dir__, run_cmi_script
5+
6+
7+
@pytest.mark.parametrize(
8+
"relative_path",
9+
[
10+
f"{__examples_dir__}/ch05Fit2Phase/solutions/diffpy-cmi/fit2P.py",
11+
],
12+
)
13+
def test_ch05_examples(relative_path):
14+
script_path = Path(__file__).parent.parent / relative_path
15+
run_cmi_script(script_path)

tests/test_ch06.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
from conftest import __examples_dir__, run_cmi_script
5+
6+
7+
@pytest.mark.parametrize(
8+
"relative_path",
9+
[
10+
f"{__examples_dir__}/ch06RefineCrystalStructureGen"
11+
+ "/solutions/diffpy-cmi/fitCrystalGen.py",
12+
],
13+
)
14+
def test_ch06_examples(relative_path):
15+
script_path = Path(__file__).parent.parent / relative_path
16+
run_cmi_script(script_path)

tests/test_ch07.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
from conftest import __examples_dir__, run_cmi_script
5+
6+
7+
@pytest.mark.parametrize(
8+
"relative_path",
9+
[
10+
f"{__examples_dir__}/ch07StructuralPhaseTransitions"
11+
+ "/solutions/diffpy-cmi/fitTSeries.py",
12+
],
13+
)
14+
def test_ch07_examples(relative_path):
15+
script_path = Path(__file__).parent.parent / relative_path
16+
run_cmi_script(script_path)

tests/test_ch08.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
from conftest import __examples_dir__, run_cmi_script
5+
6+
7+
@pytest.mark.parametrize(
8+
"relative_path",
9+
[
10+
f"{__examples_dir__}/ch08NPRefinement"
11+
+ "/solutions/diffpy-cmi/fitCdSeNP.py",
12+
],
13+
)
14+
def test_ch08_examples(relative_path):
15+
script_path = Path(__file__).parent.parent / relative_path
16+
run_cmi_script(script_path)

tests/test_ch11.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
from conftest import __examples_dir__, run_cmi_script
5+
6+
7+
@pytest.mark.parametrize(
8+
"relative_path",
9+
[
10+
f"{__examples_dir__}/ch11ClusterXYZ/solutions/diffpy-cmi/fitCdSeNP.py",
11+
],
12+
)
13+
def test_ch11_examples(relative_path):
14+
script_path = Path(__file__).parent.parent / relative_path
15+
run_cmi_script(script_path)

0 commit comments

Comments
 (0)