|
23 | 23 | import os |
24 | 24 | import pathlib |
25 | 25 | import shutil |
26 | | -import unittest |
27 | 26 |
|
28 | 27 | from armi import settings, utils |
29 | | -from armi.bookkeeping import historyTracker |
30 | 28 | from armi.bookkeeping.tests._constants import TUTORIAL_FILES |
31 | 29 | from armi.cases import case |
32 | 30 | from armi.context import ROOT |
33 | | -from armi.reactor import blocks, grids |
34 | 31 | from armi.reactor.flags import Flags |
35 | 32 | from armi.tests import ArmiTestHelper |
36 | 33 | from armi.utils.directoryChangers import TemporaryDirectoryChanger |
@@ -231,51 +228,3 @@ def test_getBlockInAssembly(self): |
231 | 228 | with self.assertRaises(RuntimeError): |
232 | 229 | aShield = self.o.r.core.getFirstAssembly(Flags.SHIELD) |
233 | 230 | history._getBlockInAssembly(aShield) |
234 | | - |
235 | | - |
236 | | -class TestHistoryTrackerNoModel(unittest.TestCase): |
237 | | - """History tracker tests that do not require a Reactor Model.""" |
238 | | - |
239 | | - def setUp(self): |
240 | | - cs = settings.Settings() |
241 | | - self.history = historyTracker.HistoryTrackerInterface(None, cs=cs) |
242 | | - self._origCaseTitle = self.history.cs.caseTitle # to avoid parallel test interference. |
243 | | - self.history.cs.caseTitle = self._testMethodName + self._origCaseTitle |
244 | | - |
245 | | - def tearDown(self): |
246 | | - self.history.cs.caseTitle = self._origCaseTitle |
247 | | - |
248 | | - def test_timestepFiltering(self): |
249 | | - times = range(30) |
250 | | - self.history.cs = self.history.cs.modified(newSettings={"burnSteps": 2}) |
251 | | - |
252 | | - inputs = [ |
253 | | - {"boc": True}, |
254 | | - {"moc": True}, |
255 | | - {"eoc": True}, |
256 | | - {"boc": True, "eoc": True}, |
257 | | - ] |
258 | | - results = [ |
259 | | - [0, 3, 6, 9, 12, 15, 18, 21, 24, 27], |
260 | | - [1, 4, 7, 10, 13, 16, 19, 22, 25, 28], |
261 | | - [2, 5, 8, 11, 14, 17, 20, 23, 26, 29], |
262 | | - [0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21, 23, 24, 26, 27, 29], |
263 | | - ] |
264 | | - for i, expectedResults in zip(inputs, results): |
265 | | - runResults = self.history.filterTimeIndices(times, **i) |
266 | | - self.assertEqual(runResults, expectedResults) |
267 | | - |
268 | | - def test_timestepFilteringWithGap(self): |
269 | | - times = list(range(10)) + list(range(15, 20)) |
270 | | - self.history.cs = self.history.cs.modified(newSettings={"burnSteps": 2}) |
271 | | - |
272 | | - runResults = self.history.filterTimeIndices(times, boc=True) |
273 | | - self.assertEqual(runResults, [0, 3, 6, 9, 15, 18]) |
274 | | - |
275 | | - def test_blockName(self): |
276 | | - block = blocks.HexBlock("blockName") |
277 | | - block.spatialLocator = grids.IndexLocation(0, 0, 7, None) |
278 | | - self.assertEqual( |
279 | | - self.history._getBlockHistoryFileName(block), |
280 | | - f"{self.history.cs.caseTitle}-blockName7-bHist.txt", |
281 | | - ) |
0 commit comments