Skip to content

Commit 41552fb

Browse files
committed
reorganize test fixtures and add test for abc.pblang composite
1 parent d895e5f commit 41552fb

File tree

9 files changed

+26
-1
lines changed

9 files changed

+26
-1
lines changed

tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from tests.fixtures.model_fixtures import ( # noqa: F401
2+
model_path_abc,
3+
)

tests/fixtures/__init__.py

Whitespace-only changes.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// my model
22
type float builtin
3+
type string builtin
34

45
process_def add_nums path toy.AddFloatsRepeatedly
56
var left_hand_addend: float
@@ -9,7 +10,7 @@ process_def add_nums path toy.AddFloatsRepeatedly
910
outputs result
1011

1112
process_def print_result path toy.SaveFloatToFile
12-
//param output_file_path: string default "~/abc_result.txt"
13+
param output_file_path: string default "~/abc_result.txt"
1314
var result: float
1415
inputs result
1516

File renamed without changes.

tests/fixtures/model_fixtures.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
@pytest.fixture
6+
def model_path_abc() -> Path:
7+
"""Fixture for a model file."""
8+
return Path(__file__).parent / "data" / "abc.pblang"

tests/test_add.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from pathlib import Path
2+
3+
from process_bigraph_lang.dsl.model import Model
4+
5+
from simple_process_bigraph_runtime.main import generatePythonModel, performConversion
6+
7+
8+
def test_add(model_path_abc: Path) -> None:
9+
ast_model: Model = generatePythonModel(model_path_abc)
10+
pb_composite, _0, _1 = performConversion(ast_model)
11+
12+
duration = 10.0
13+
pb_composite.run(duration)

0 commit comments

Comments
 (0)