File: test_launchpad_244811.py

package info (click to toggle)
pyephem 4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,380 kB
  • sloc: ansic: 77,574; python: 2,529; makefile: 74
file content (24 lines) | stat: -rw-r--r-- 801 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import unittest
import ephem

# Make sure that a series of next-risings does not keep returning the
# same time over and over again.

class Launchpad244811Tests(unittest.TestCase):
    def runTest(self):
        boston = ephem.city("Boston")
        boston.pressure = 1010.0 # undo pressure auto-adjustment
        mars = ephem.Mars()
        cur_date = ephem.Date("2009/6/29 07:00:00")

        cur_date = boston.next_rising(mars, start=cur_date)
        self.assertEqual(str(cur_date), '2009/6/30 06:17:37')

        cur_date = boston.next_rising(mars, start=cur_date)
        self.assertEqual(str(cur_date), '2009/7/1 06:15:45')

        cur_date = boston.next_rising(mars, start=cur_date)
        self.assertEqual(str(cur_date), '2009/7/2 06:13:53')