class TestCoreShellCylinder(unittest.TestCase): """ Unit tests for calculate_ER (CoreShellcylinder model) """ def setUp(self): from sas.models.CoreShellCylinderModel import CoreShellCylinderModel from sas.models.DiamCylFunc import DiamCylFunc self.comp = CoreShellCylinderModel() self.diam = DiamCylFunc() def test(self): """ Test 1D model for a CoreShellCylinder """ self.comp.setParam("radius", 20) self.comp.setParam("thickness", 10) self.comp.setParam("length", 400) self.diam.setParam("radius", 30) self.diam.setParam("length", 420) self.assertAlmostEqual(self.comp.calculate_ER(), self.diam.run(0.1) / 2)
class TestCoreShellCylinder(unittest.TestCase): """ Unit tests for calculate_ER (CoreShellcylinder model) """ def setUp(self): from sas.models.CoreShellCylinderModel import CoreShellCylinderModel from sas.models.DiamCylFunc import DiamCylFunc self.comp = CoreShellCylinderModel() self.diam = DiamCylFunc() def test(self): """ Test 1D model for a CoreShellCylinder """ self.comp.setParam("radius", 20) self.comp.setParam("thickness", 10) self.comp.setParam("length",400) self.diam.setParam("radius", 30) self.diam.setParam("length",420) self.assertAlmostEqual(self.comp.calculate_ER(), self.diam.run(0.1)/2)