Sha256: 4c86f70e64312c4cadfa74e9982c5dae8a1b5d8feb4dccbc3359c4c6272fe5d6

Contents?: true

Size: 1.26 KB

Versions: 101

Compression:

Stored size: 1.26 KB

Contents

from datetime import datetime
import unittest

from gigasecond import add_gigasecond


class GigasecondTest(unittest.TestCase):
    def test_1(self):
        self.assertEqual(
            datetime(2043, 1, 1, 1, 46, 40),
            add_gigasecond(datetime(2011, 4, 25))
        )

    def test_2(self):
        self.assertEqual(
            datetime(2009, 2, 19, 1, 46, 40),
            add_gigasecond(datetime(1977, 6, 13))
        )

    def test_3(self):
        self.assertEqual(
            datetime(1991, 3, 27, 1, 46, 40),
            add_gigasecond(datetime(1959, 7, 19))
        )

    def test_4(self):
        self.assertEqual(
            datetime(2046, 10, 2, 23, 46, 40),
            add_gigasecond(datetime(2015, 1, 24, 22, 0, 0))
        )

    def test_5(self):
        self.assertEqual(
            datetime(2046, 10, 3, 1, 46, 39),
            add_gigasecond(datetime(2015, 1, 24, 23, 59, 59))
        )

    def test_yourself(self):
        # customize this to test your birthday and find your gigasecond date:
        your_birthday = datetime(1970, 1, 1)
        your_gigasecond = datetime(2001, 9, 9, 1, 46, 40)

        self.assertEqual(
            your_gigasecond,
            add_gigasecond(your_birthday)
        )


if __name__ == '__main__':
    unittest.main()

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
trackler-2.0.8.27 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.26 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.24 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.23 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.22 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.21 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.20 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.19 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.18 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.17 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.16 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.15 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.14 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.13 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.12 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.11 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.10 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.9 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.8 tracks/python/exercises/gigasecond/gigasecond_test.py
trackler-2.0.8.7 tracks/python/exercises/gigasecond/gigasecond_test.py