本文整理汇总了Python中space_age.SpaceAge类的典型用法代码示例。如果您正苦于以下问题:Python SpaceAge类的具体用法?Python SpaceAge怎么用?Python SpaceAge使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SpaceAge类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_age_on_uranus
def test_age_on_uranus(self):
age = SpaceAge(3210123456)
self.assertEqual(age.on_earth(), 101.72)
self.assertEqual(age.on_uranus(), 1.21)
示例2: test_age_on_neptune
def test_age_on_neptune(self):
age = SpaceAge(8210123456)
self.assertEqual(age.on_earth(), 260.16)
self.assertEqual(age.on_neptune(), 1.58)
示例3: test_age_on_jupiter
def test_age_on_jupiter(self):
age = SpaceAge(901876382)
self.assertEqual(age.on_earth(), 28.58)
self.assertEqual(age.on_jupiter(), 2.41)
示例4: test_age_on_saturn
def test_age_on_saturn(self):
age = SpaceAge(3e9)
self.assertEqual(age.on_earth(), 95.06)
self.assertEqual(age.on_saturn(), 3.23)
示例5: test_age_in_venus_years
def test_age_in_venus_years(self):
age = SpaceAge(189839836)
self.assertEqual(age.on_earth(), 6.02)
self.assertEqual(age.on_venus(), 9.78)
示例6: test_age_on_mars
def test_age_on_mars(self):
age = SpaceAge(2329871239)
self.assertEqual(age.on_earth(), 73.83)
self.assertEqual(age.on_mars(), 39.25)
示例7: test_age_in_mercury_years
def test_age_in_mercury_years(self):
age = SpaceAge(2134835688)
self.assertEqual(age.on_earth(), 67.65)
self.assertEqual(age.on_mercury(), 280.88)
示例8: test_age_in_earth_years
def test_age_in_earth_years(self):
age = SpaceAge(1e9)
self.assertEqual(age.on_earth(), 31.69)
示例9: test_age_on_saturn
def test_age_on_saturn(self):
age = SpaceAge(3e9)
self.assertEqual(95.06, age.on_earth())
self.assertEqual(3.23, age.on_saturn())
示例10: test_age_on_mars
def test_age_on_mars(self):
age = SpaceAge(2329871239)
self.assertEqual(73.83, age.on_earth())
self.assertEqual(39.25, age.on_mars())
示例11: test_age_in_venus_years
def test_age_in_venus_years(self):
age = SpaceAge(189839836)
self.assertEqual(6.02, age.on_earth())
self.assertEqual(9.78, age.on_venus())