Skip to content

Commit

Permalink
Ensure that the .vtu and .pvtu files are not present prior to calling…
Browse files Browse the repository at this point in the history
… inspect
  • Loading branch information
dalg24 committed Dec 8, 2016
1 parent 8b9ba78 commit 1c208f9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions python/test/test_energy_storage_device_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,18 @@ def test_postprocessor_inspect(self):
ptree.parse_info('super_capacitor.info')
ptree.put_int('dim', 3)
device = EnergyStorageDevice(ptree)
data = device.inspect('postprocessor')
self.assertTrue(isinstance(data, dict))
self.assertEqual(len(data), 0)
# check that vtu and pvtu files have been created
# vtu and pvtu files are created when inspecting the device with the
# postprocessor
vtu_file = 'solution-0000.0000.vtu'
pvtu_file = 'solution-0000.pvtu'
# ensure that the files are not present prior to calling inspect
self.assertFalse(os.path.isfile(vtu_file))
self.assertFalse(os.path.isfile(pvtu_file))
# inspect
data = device.inspect('postprocessor')
self.assertTrue(isinstance(data, dict))
self.assertTrue(not data)
# check that the files have been created
self.assertTrue(os.path.isfile(vtu_file))
self.assertTrue(os.path.isfile(pvtu_file))
# clean files
Expand Down

0 comments on commit 1c208f9

Please sign in to comment.