mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Update capi tally activation test
This commit is contained in:
parent
3c727f7364
commit
3aa4a6f6da
1 changed files with 14 additions and 5 deletions
|
|
@ -49,7 +49,13 @@ def capi_init(pincell_model):
|
|||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def capi_run(capi_init):
|
||||
def capi_simulation_init(pincell_model):
|
||||
openmc.capi.simulation_init()
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def capi_run(capi_simulation_init):
|
||||
openmc.capi.run()
|
||||
|
||||
|
||||
|
|
@ -173,10 +179,6 @@ def test_tally(capi_init):
|
|||
t.scores = new_scores
|
||||
assert t.scores == new_scores
|
||||
|
||||
assert not t.active
|
||||
t.active = True
|
||||
assert t.active
|
||||
|
||||
t2 = openmc.capi.tallies[2]
|
||||
t2.id = 2
|
||||
assert len(t2.filters) == 2
|
||||
|
|
@ -196,6 +198,13 @@ def test_new_tally(capi_init):
|
|||
assert len(openmc.capi.tallies) == 4
|
||||
|
||||
|
||||
def test_tally_activate(capi_simulation_init):
|
||||
t = openmc.capi.tallies[1]
|
||||
assert not t.active
|
||||
t.active = True
|
||||
assert t.active
|
||||
|
||||
|
||||
def test_tally_results(capi_run):
|
||||
t = openmc.capi.tallies[1]
|
||||
assert t.num_realizations == 10 # t was made active in test_tally
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue