Sha256: 68d7b07cfa054c716a4a07a5dd7a30673362770d52a542110df726cb0e39724d

Contents?: true

Size: 1.12 KB

Versions: 73

Compression:

Stored size: 1.12 KB

Contents

import unittest

from space_age import SpaceAge


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0

class SpaceAgeTest(unittest.TestCase):

    def test_age_on_mercury(self):
        self.assertEqual(SpaceAge(2134835688).on_mercury(), 280.88)

    def test_age_on_venus(self):
        self.assertEqual(SpaceAge(189839836).on_venus(), 9.78)

    def test_age_on_earth(self):
        self.assertEqual(SpaceAge(1000000000).on_earth(), 31.69)

    def test_age_on_mars(self):
        self.assertEqual(SpaceAge(2329871239).on_mars(), 39.25)

    def test_age_on_jupiter(self):
        self.assertEqual(SpaceAge(901876382).on_jupiter(), 2.41)

    def test_age_on_saturn(self):
        self.assertEqual(SpaceAge(3000000000).on_saturn(), 3.23)

    def test_age_on_uranus(self):
        self.assertEqual(SpaceAge(3210123456).on_uranus(), 1.21)

    def test_age_on_neptune(self):
        self.assertEqual(SpaceAge(8210123456).on_neptune(), 1.58)

    # Additional tests for this track

    def test_age_in_seconds(self):
        self.assertEqual(SpaceAge(1e6).seconds, 1e6)


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

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.179 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.178 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.177 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.176 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.175 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.174 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.173 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.172 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.171 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.170 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.169 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.167 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.166 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.165 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.164 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.163 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.162 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.161 tracks/python/exercises/space-age/space_age_test.py
trackler-2.2.1.160 tracks/python/exercises/space-age/space_age_test.py