Esempio n. 1
0
    def test(self):
        """
        DocTests exceptions (pychemia.utils)                         :
        """
        from pychemia.utils.periodic import atomic_number
        with self.assertRaises(Exception) as context:
            atomic_number(['H', u'A'])
        # self.assertTrue(u'Atomic symbol not found' == context.exception)

        from pychemia.utils.computing import read_file
        with self.assertRaises(Exception) as context:
            read_file('/dev/abc')
        # self.assertTrue('Could not open file: /dev/abc' in context.exception)

        from pychemia.utils.computing import get_float
        with self.assertRaises(Exception) as context:
            get_float('3i')
Esempio n. 2
0
 def from_file(filename):
     return CIF(read_file(filename))
Esempio n. 3
0
 def from_file(filename):
     return CIF(read_file(filename))