Skip to content

Commit

Permalink
adding test
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed May 21, 2024
1 parent e552d42 commit cdbca46
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions idaes/core/base/tests/test_process_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def test_scalar_noargs(self):
assert isinstance(m.b.y, Var)
assert value(m.b.x) == 1001
assert value(m.b.y) == 1002
assert m.b.process_block_class() is MyBlock
assert m.b.parent_component().process_block_class() is MyBlock

@pytest.mark.unit
def test_vec_noargs(self):
Expand All @@ -59,6 +61,8 @@ def test_vec_noargs(self):
assert value(m.b[2].y) == 1002
assert value(m.b[3].x) == 1001
assert value(m.b[3].y) == 1002
assert m.b[2].parent_component().process_block_class() is MyBlock
assert m.b.process_block_class() is MyBlock

@pytest.mark.unit
def test_scalar_args1(self):
Expand All @@ -68,6 +72,8 @@ def test_scalar_args1(self):
assert isinstance(m.b.y, Var)
assert value(m.b.x) == 1
assert value(m.b.y) == 2
assert m.b.process_block_class() is MyBlock
assert m.b.parent_component().process_block_class() is MyBlock

@pytest.mark.unit
def test_scalar_args2(self):
Expand All @@ -77,6 +83,8 @@ def test_scalar_args2(self):
assert isinstance(m.b.y, Var)
assert value(m.b.x) == 1
assert value(m.b.y) == 2
assert m.b.process_block_class() is MyBlock
assert m.b.parent_component().process_block_class() is MyBlock

@pytest.mark.unit
def test_vec_args(self):
Expand All @@ -97,6 +105,8 @@ def test_vec_args(self):
assert value(m.b[2].y) == 2002
assert value(m.b[3].x) == 1
assert value(m.b[3].y) == 2
assert m.b[2].parent_component().process_block_class() is MyBlock
assert m.b.process_block_class() is MyBlock

@pytest.mark.unit
def test_user_map(self):
Expand Down Expand Up @@ -128,3 +138,5 @@ def new_imap(i):
assert value(m.b[3].y) == 5002
assert value(m.b[4].x) == 7001
assert value(m.b[4].y) == 7002
assert m.b[2].parent_component().process_block_class() is MyBlock
assert m.b.process_block_class() is MyBlock

0 comments on commit cdbca46

Please sign in to comment.