Erik Grinaker is sharing code with you
Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.
Don't show this againpython-chrono / tests / test_error.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | #!/usr/bin/env python
import chrono
import unittest
class DateErrorTest(unittest.TestCase):
def test_subclass(self):
"DateError is a subclass of DatetimeError"
self.assertTrue(issubclass(chrono.DateError, chrono.DateTimeError))
class DateTimeErrorTest(unittest.TestCase):
def test_subclass(self):
"DateTimeError is a subclass of ValueError"
self.assertTrue(issubclass(chrono.DateTimeError, ValueError))
class DayErrorTest(unittest.TestCase):
def test_subclass(self):
"DayError is a subclass of DateError"
self.assertTrue(issubclass(chrono.DayError, chrono.DateError))
class HourErrorTest(unittest.TestCase):
def test_subclass(self):
"HourError is a subclass of TimeError"
self.assertTrue(issubclass(chrono.HourError, chrono.TimeError))
class MinuteErrorTest(unittest.TestCase):
def test_subclass(self):
"MinuteError is a subclass of TimeError"
self.assertTrue(issubclass(chrono.MinuteError, chrono.TimeError))
class MonthErrorTest(unittest.TestCase):
def test_subclass(self):
"MonthError is a subclass of DateError"
self.assertTrue(issubclass(chrono.MonthError, chrono.DateError))
class NoDateTimeError(unittest.TestCase):
def test_subclass(self):
"NoDateTimeError is subclass of Exception"
self.assertTrue(issubclass(chrono.NoDateTimeError, Exception))
class ParseErrorTest(unittest.TestCase):
def test_subclass(self):
"ParseError is a subclass of ValueError"
self.assertTrue(issubclass(chrono.ParseError, ValueError))
class SecondErrorTest(unittest.TestCase):
def test_subclass(self):
"SecondError is a subclass of TimeError"
self.assertTrue(issubclass(chrono.SecondError, chrono.TimeError))
class TimeErrorTest(unittest.TestCase):
def test_subclass(self):
"TimeError is a subclass of DatetimeError"
self.assertTrue(issubclass(chrono.TimeError, chrono.DateTimeError))
class WeekErrorTest(unittest.TestCase):
def test_subclass(self):
"WeekError is a subclass of DateError"
self.assertTrue(issubclass(chrono.WeekError, chrono.DateError))
class YearErrorTest(unittest.TestCase):
def test_subclass(self):
"YearError is a subclass of DateError"
self.assertTrue(issubclass(chrono.YearError, chrono.DateError))
if __name__ == "__main__":
unittest.main()
|