Skip to content

Commit 81a81a7

Browse files
committed
Use local copy of demo model for testing.
In an effort to keep all test fixtures in one place, a copy of the tutorial model `capacitor.mph` from the `demos` folder was placed in the `tests` folder, under the name `demo.mph`. That file is used by very few tests: Only for loading files from disk when testing the client, and when comparing tags created by MPh with those generated by Comsol. All other tests create the (same) model from scratch, via the `capacitor()` fixture in `models.py`.
1 parent 1b6e489 commit 81a81a7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

tests/demo.mph

97.6 KB
Binary file not shown.

tests/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
########################################
1616
client = None
1717
model = None
18-
demo = Path(__file__).resolve().parent.parent/'demos'/'capacitor.mph'
18+
demo = Path(__file__).resolve().parent/'demo.mph'
1919

2020

2121
########################################
@@ -63,7 +63,7 @@ def test_repr():
6363

6464
def test_contains():
6565
assert model in client
66-
assert 'capacitor' in client
66+
assert 'demo' in client
6767
assert 'empty' in client
6868
assert 'non-existing' not in client
6969

@@ -74,7 +74,7 @@ def test_iter():
7474

7575

7676
def test_truediv():
77-
assert client/'capacitor' == model
77+
assert client/'demo' == model
7878
with logging_disabled():
7979
with raises(ValueError):
8080
client/'non-existing'

tests/test_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_tag():
9999
if not client.port:
100100
# Skip test in client-server mode where it's fairly slow.
101101
here = Path(__file__).resolve().parent
102-
demo = client.load(here.parent/'demos'/'capacitor.mph')
102+
demo = client.load(here/'demo.mph')
103103
demo.solve()
104104
root = Node(model, '')
105105
compare_tags(root, demo)

0 commit comments

Comments
 (0)