<commit_before>import unittest

import hw1pr2 as hw

class sqTests(unittest.TestCase):
    def testZeroSq(self):
        self.assertEqual(hw.sq(0), 0)
    def testOneSq(self):
        self.assertEqual(hw.sq(1), 1)
    def testNegOneSq(self):
        self.assertEqual(hw.sq(-1), 1)
    def testFourSq(self):
        self.assertEqual(hw.sq(4), 16)
    def testNegfourSq(self):
        self.assertEqual(hw.sq(-4), 16)

class interpTests(unittest.TestCase):
    def testInterpT1(self):
        self.assertEqual(3.0, hw.interp(1.0, 9.0, 0.25))
    def testInterpT2(self):
        self.assertEqual(31.5, hw.interp(1.0, 3.0, 0.25))
    def testInterpT3(self):
        self.assertEqual(4.2, hw.interp(2, 12, 0.22))
    def testInterpT4(self):
        self.assertEqual(24.0, hw.interp(24, 42, 0))
    def testInterpT5(self):
        self.assertEqual(42.0, hw.interp(102, 117, -4.0))

class checkendsTests(unittest.TestCase):
    def testCheckendsT1(self):
        self.assertEqual(False, hw.checkends('no match'))
    def testCheckendsT2(self):
        self.assertEqual(True, hw.checkends('hah! a match'))
    def testCheckendsT3(self):
        self.assertEqual(True, hw.checkends('q'))
    def testCheckendsT4(self):
        self.assertEqual(True, hw.checkends(' '))

class flipsideTests(unittest.TestCase):
    def testFlipsideT1(self):
        self.assertEqual('workhome', hw.flipside('homework'))
    def testFlipsideT2(self):
        self.assertEqual('petscar', hw.flipside('carpets'))
    def testFlipsideT3(self):
        self.assertEqual('q', hw.flipside('q'))
    def testFlipsideT4(self):
        self.assertEqual(' ', hw.flipside(' '))

class convertFromSecondsTests(unittest.TestCase):
    def testConvertFromSecondsT1(self):
        self.assertEqual([0,0,10,10], hw.convertFromSeconds(610))
    def testConvertFromSecondsT2(self):
        self.assertEqual([1,3,46,40], hw.convertFromSeconds(100000))


if __name__ == '__main__':
    unittest.main()<commit_msg>Updated hw1pr2 tests: more informative test names and changed inputs<commit_after>import unittest

import hw1pr2 as hw

class sqTests(unittest.TestCase):
    def testZeroSq(self):
        self.assertEqual(hw.sq(0), 0)
    def testOneSq(self):
        self.assertEqual(hw.sq(1), 1)
    def testNegOneSq(self):
        self.assertEqual(hw.sq(-1), 1)
    def testFourSq(self):
        self.assertEqual(hw.sq(4), 16)
    def testNegfourSq(self):
        self.assertEqual(hw.sq(-4), 16)

class interpTests(unittest.TestCase):
    def testInterpSameHighAndLow(self):
        self.assertEqual(0.0, hw.interp(0.0, 0.0, 0.1))
    def testInterpFracOverOne(self):
        self.assertEqual(5.0, hw.interp(1.0, 3.0, 2.0))
    def testInterpNegFraction(self):
        self.assertEqual(0.5, hw.interp(1.0, 3.0, -0.25))
    def testInterpZeroFraction(self):
        self.assertEqual(10.0, hw.interp(10.0, 100, 0))

class checkendsTests(unittest.TestCase):
    def testCheckendsNoMatch(self):
        self.assertEqual(False, hw.checkends('hello world'))
    def testCheckendsDiffCase(self):
        self.assertEqual(False, hw.checkends('aaaaAAAA'))
    def testCheckendsNonLettters(self):
        self.assertEqual(True, hw.checkends('123 321'))
    def testCheckendsMatching(self):
        self.assertEqual(True, hw.checkends('racecar'))
    def testCheckendsSingleChar(self):
        self.assertEqual(True, hw.checkends('z'))
    def testCheckendsBlankString(self):
        self.assertEqual(True, hw.checkends(' '))

class flipsideTests(unittest.TestCase):
    def testFlipsideEvenLength(self):
        self.assertEqual('cattom', hw.flipside('tomcat'))
    def testFlipsideOddLength(self):
        self.assertEqual('homefun', hw.flipside('funhome'))
    def testFlipsideSingleChar(self):
        self.assertEqual('z', hw.flipside('z'))
    def testFlipsideBlankString(self):
        self.assertEqual(' ', hw.flipside(' '))

class convertFromSecondsTests(unittest.TestCase):
    def testConvertFromSecondsOnlySecs(self):
        self.assertEqual([0,0,0,30], hw.convertFromSeconds(30))
    def testConvertFromSecondsSecsAndMins(self):
        self.assertEqual([0,0,11,40], hw.convertFromSeconds(700))
    def testConvertFromSecondsSecsMinsHrs(self):
        self.assertEqual([0,1,12,1], hw.convertFromSeconds(4321))      
    def testConvertFromSecondsSecsMinsHrsDay(self):
        self.assertEqual([1,23,13,20], hw.convertFromSeconds(1700000))


if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.14121621621621622, 'fraction_numerical': 0.043243243243243246, 'mean_word_length': 3.7855603448275863, 'pattern_counts': {'":': 0, '<': 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': '4814194', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1504, 'n_words': 243}