コード例 #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)