Ejemplo n.º 1
0
 def test_is_contextual(self):
     """Test is_contextual method returns expected result."""
     self.assertEqual(Compound(names=['Coumarin 343']).is_contextual, False)
     self.assertEqual(
         Compound(melting_points=[MeltingPoint(value='240')]).is_contextual,
         False)
     self.assertEqual(
         Compound(melting_points=[MeltingPoint(units='K')]).is_contextual,
         True)
     self.assertEqual(
         Compound(melting_points=[MeltingPoint(
             apparatus='Some apparatus')]).is_contextual, True)
     self.assertEqual(
         Compound(labels=['3a'],
                  melting_points=[MeltingPoint(apparatus='Some apparatus')
                                  ]).is_contextual, False)
     self.assertEqual(
         Compound(uvvis_spectra=[UvvisSpectrum(
             apparatus='Some apparatus')]).is_contextual, True)
     self.assertEqual(
         Compound(
             uvvis_spectra=[UvvisSpectrum(peaks=[UvvisPeak(
                 value='378')])]).is_contextual, False)
     self.assertEqual(
         Compound(
             uvvis_spectra=[UvvisSpectrum(peaks=[UvvisPeak(
                 units='nm')])]).is_contextual, True)
Ejemplo n.º 2
0
 def test_is_unidentified(self):
     """Test is_unidentified method returns expected result."""
     self.assertEqual(Compound().is_unidentified, True)
     self.assertEqual(
         Compound(names=['Coumarin 343']).is_unidentified, False)
     self.assertEqual(Compound(labels=['3a']).is_unidentified, False)
     self.assertEqual(
         Compound(names=['Coumarin 343'], labels=['3a']).is_unidentified,
         False)
     self.assertEqual(
         Compound(melting_points=[MeltingPoint(
             value='250')]).is_unidentified, True)