Debian Codegraph @

test/data/testTDun.py

raw
1 # -*- coding: utf-8 -*-
2 #
3 # Copyright (c) 2017, the cclib development team
4 #
5 # This file is part of cclib (http://cclib.github.io) and is distributed under
6 # the terms of the BSD 3-Clause License.
7
8 """Test single point, unrestricted time-dependent logfiles in cclib"""
9
10 import os
11 import unittest
12
13 import numpy
14
15 from skip import skipForParser
16
17 __filedir__ = os.path.realpath(os.path.dirname(__file__))
18
19
20 class GenericTDunTest(unittest.TestCase):
21 """Generic time-dependent unrestricted HF/DFT unittest"""
22
23 number = 24
24
25 @skipForParser('Molcas','The parser is still being developed so we skip this test')
26 @skipForParser('Turbomole','The parser is still being developed so we skip this test')
27 def testenergiesnumber(self):
28 """Is the length of etenergies correct?"""
29 self.assertEqual(len(self.data.etenergies), self.number)
30
31 @skipForParser('Molcas','The parser is still being developed so we skip this test')
32 @skipForParser('Turbomole','The parser is still being developed so we skip this test')
33 def testoscsnumber(self):
34 """Is the length of eotscs correct?"""
35 self.assertEqual(len(self.data.etoscs), self.number)
36
37 @skipForParser('Molcas','The parser is still being developed so we skip this test')
38 @skipForParser('Turbomole','The parser is still being developed so we skip this test')
39 def testrotatsnumber(self):
40 """Is the length of etrotats correct?"""
41 self.assertEqual(len(self.data.etrotats), self.number)
42
43 @skipForParser('Molcas','The parser is still being developed so we skip this test')
44 @skipForParser('Turbomole','The parser is still being developed so we skip this test')
45 def testsecsnumber(self):
46 """Is the length of etsecs correct?"""
47 self.assertEqual(len(self.data.etsecs), self.number)
48
49 @skipForParser('Molcas','The parser is still being developed so we skip this test')
50 @skipForParser('Turbomole','The parser is still being developed so we skip this test')
51 def testsymsnumber(self):
52 """Is the length of etsyms correct?"""
53 self.assertEqual(len(self.data.etsyms), self.number)
54
55 @skipForParser('Molcas','The parser is still being developed so we skip this test')
56 @skipForParser('Turbomole','The parser is still being developed so we skip this test')
57 def testsyms(self):
58 """Is etsyms populated by singlets and triplets 50/50?"""
59 singlets = [sym for sym in self.data.etsyms if "Singlet" in sym]
60 triplets = [sym for sym in self.data.etsyms if "Triplet" in sym]
61 self.assertEqual(len(singlets), self.number/2)
62 self.assertEqual(len(triplets), self.number/2)
63
64
65 if __name__=="__main__":
66
67 import sys
68 sys.path.insert(1, os.path.join(__filedir__, ".."))
69
70 from test_data import DataSuite
71 suite = DataSuite(['TDun'])
72 suite.testall()