<commit_before><commit_msg>Tests: Forgot to check in this test, which I've moved from TestTD.py to here as unrestricted calculations often need more work.<commit_after>__revision__ = "$Revision: 772 $"

import numpy

import bettertest


class GenericTDunTest(bettertest.TestCase):
    """Time-dependent HF/DFT unittest for unrestricted case."""

    def testenergiesnumber(self):
        """Is the length of etenergies correct?"""
        self.assertEqual(len(self.data.etenergies), self.number)
    
    def testoscsnumber(self):
        """Is the length of eotscs correct?"""
        self.assertEqual(len(self.data.etoscs), self.number)

    def testrotatsnumber(self):
        """Is the length of etrotats correct?"""
        self.assertEqual(len(self.data.etrotats), self.number)

    def testsecsnumber(self):
        """Is the length of etsecs correct?"""
        self.assertEqual(len(self.data.etsecs), self.number)

    def testsymsnumber(self):
        """Is the length of etsyms correct?"""
        self.assertEqual(len(self.data.etsyms), self.number)

class GaussianTDDFTunTest(GenericTDunTest):
    """Gaussian time-dependent HF/DFT unittest."""

    number = 24
    
    def testsyms(self):
        """Is etsyms populated by singlets and triplets 50/50?"""
        singlets = [sym for sym in self.data.etsyms if "Singlet" in sym]
        triplets = [sym for sym in self.data.etsyms if "Triplet" in sym]
        self.assertEqual(len(singlets), self.number/2)
        self.assertEqual(len(triplets), self.number/2)

if __name__=="__main__":

    from testall import testall
    testall(modules=["TDun"])
{'fraction_non_alphanumeric': 0.11833952912019827, 'fraction_numerical': 0.006815365551425031, 'mean_word_length': 3.4246575342465753, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3257686', 'n_tokens_mistral': 519, 'n_tokens_neox': 491, 'n_words': 134}