예제 #1
0
    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)
예제 #2
0
 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))
예제 #3
0
 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)
예제 #4
0
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)
예제 #5
0
def sample():
    return InclusionSample(COPPER, ZINC, 123.456)
예제 #6
0
 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))
예제 #7
0
 def test__eq__(self):
     s = InclusionSample(COPPER, ZINC, 123.456)
     self.assertEqual(s, self.s)
예제 #8
0
    def setUp(self):
        super().setUp()

        self.s = InclusionSample(COPPER, ZINC, 123.456)