Beispiel #1
0
 def testReadHexGeomXML(self):
     geom = SystemLayoutInput()
     geom.readGeomFromFile(os.path.join(TEST_ROOT, "geom.xml"))
     self.assertEqual(str(geom.geomType), geometry.HEX)
     self.assertEqual(geom.assemTypeByIndices[(1, 1)], "IC")
     out = os.path.join(TEST_ROOT, "geom-output.xml")
     geom.writeGeom(out)
     os.remove(out)
Beispiel #2
0
 def test_TRZyamlIO(self):
     geom = SystemLayoutInput()
     geom.readGeomFromFile(os.path.join(TEST_ROOT, "trz_geom.xml"))
     fName = "testTRZYamlIO.yaml"
     with open(fName, "w") as f:
         geom._writeYaml(f)  # pylint: disable=protected-access
     with open(fName) as f:
         geom2 = SystemLayoutInput()
         geom2._readYaml(f)  # pylint: disable=protected-access
     self.assertEqual(geom2.assemTypeByIndices[2.0, 3.0, 0.0, 180.0, 1, 1], "MC")
     os.remove(fName)
Beispiel #3
0
 def testReadTRZGeomXML(self):
     geom = SystemLayoutInput()
     geom.readGeomFromFile(os.path.join(TEST_ROOT, "trz_geom.xml"))
     self.assertEqual(str(geom.geomType), geometry.RZT)
     self.assertEqual(geom.assemTypeByIndices[(0.0, 2.0, 0.0, 360.0, 1, 1)],
                      "IC")