def test__ne__(self): s = InclusionSample(COPPER, GALLIUM, 123.456) self.assertNotEqual(s, self.s) s = InclusionSample(GALLIUM, ZINC, 123.456) self.assertNotEqual(s, self.s) s = InclusionSample(COPPER, ZINC, 124.456) self.assertNotEqual(s, self.s)
def testconvert(self): handler = InclusionSampleHtmlHandler() sample = InclusionSample(Material.pure(29), Material.pure(30), 50e-9, 0.1, 0.2) root = handler.convert(sample) self.assertEqual(8, len(root.children))
def testconvert_parse(self): handler = InclusionSampleHDF5Handler() sample = InclusionSample(Material.pure(29), Material.pure(30), 50e-9, 0.1, 0.2) sample2 = self.convert_parse_hdf5handler(handler, sample) self.assertEqual(sample2, sample)
def test_inclusionsample_eq(sample): assert sample == InclusionSample(COPPER, ZINC, 123.456) assert sample != InclusionSample(COPPER, GALLIUM, 123.456) assert sample != InclusionSample(GALLIUM, ZINC, 123.456) assert sample != InclusionSample(COPPER, ZINC, 124.456)
def sample(): return InclusionSample(COPPER, ZINC, 123.456)
def testconvert(self): handler = InclusionSampleSeriesHandler() sample = InclusionSample(Material.pure(29), Material.pure(30), 50e-9, 0.1, 0.2) s = handler.convert(sample) self.assertEqual(7, len(s))
def test__eq__(self): s = InclusionSample(COPPER, ZINC, 123.456) self.assertEqual(s, self.s)
def setUp(self): super().setUp() self.s = InclusionSample(COPPER, ZINC, 123.456)