Skip to content

Commit

Permalink
Add docs for ParameterCollectionWhere tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drewj-tp committed Sep 20, 2024
1 parent 18e5219 commit e335f07
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions armi/reactor/tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ class MockPCChild(MockPC):


class ParamCollectionWhere(unittest.TestCase):
"""Tests for ParameterCollection.where."""

class ScopeParamCollection(parameters.ParameterCollection):
pDefs = parameters.ParameterDefinitionCollection()
with pDefs.createBuilder() as pb:
Expand Down Expand Up @@ -556,6 +558,7 @@ def setUpClass(cls) -> None:
cls.pc = cls.ScopeParamCollection()

def test_onCategory(self):
"""Test the use of Parameter.hasCategory on filtering."""
names = {"keff", "cornerFlux"}
for p in self.pc.where(
lambda pd: pd.hasCategory(parameters.Category.neutronics)
Expand All @@ -565,6 +568,7 @@ def test_onCategory(self):
self.assertFalse(names, msg=f"{names=} should be empty!")

def test_onLocation(self):
"""Test the use of Parameter.atLocation in filtering."""
names = {
"edgeTemperature",
}
Expand All @@ -576,6 +580,7 @@ def test_onLocation(self):
self.assertFalse(names, msg=f"{names=} should be empty!")

def test_complicated(self):
"""Test a multi-condition filter."""
names = {
"cornerFlux",
}
Expand Down

0 comments on commit e335f07

Please sign in to comment.