示例#1
0
def test_substratesample_eq(sample):
    assert sample == SubstrateSample(COPPER)
    assert sample != SubstrateSample(ZINC)
    assert sample != SubstrateSample(COPPER, 1.1)
示例#2
0
 def testconvert(self):
     handler = SubstrateSampleSeriesHandler()
     sample = SubstrateSample(Material.pure(29), 0.1, 0.2)
     s = handler.convert(sample)
     self.assertEqual(4, len(s))
示例#3
0
def sample():
    return SubstrateSample(COPPER)
示例#4
0
 def testconvert(self):
     handler = SubstrateSampleHtmlHandler()
     sample = SubstrateSample(Material.pure(29), 0.1, 0.2)
     root = handler.convert(sample)
     self.assertEqual(4, len(root.children))
示例#5
0
 def testconvert_parse(self):
     handler = SubstrateSampleHDF5Handler()
     sample = SubstrateSample(Material.pure(29), 0.1, 0.2)
     sample2 = self.convert_parse_hdf5handler(handler, sample)
     self.assertEqual(sample2, sample)
示例#6
0
    def test__ne__(self):
        s = SubstrateSample(ZINC)
        self.assertNotEqual(s, self.s)

        s = SubstrateSample(COPPER, 1.1)
        self.assertNotEqual(s, self.s)
示例#7
0
 def test__eq__(self):
     s = SubstrateSample(COPPER)
     self.assertEqual(s, self.s)
示例#8
0
    def setUp(self):
        super().setUp()

        self.s = SubstrateSample(COPPER)