Skip to content

Commit

Permalink
Added Horizons test (+10 sec runtime)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannorein committed Nov 22, 2015
1 parent 2f08b45 commit fec16c5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rebound/tests/test_horizons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import rebound
import unittest
import datetime

class TestHorizons(unittest.TestCase):
def setUp(self):
self.sim = rebound.Simulation()

def tearDown(self):
self.sim = None

def test_earth(self):
self.sim.add("Earth",date="2000-01-01 00:00")
self.assertAlmostEqual(self.sim.particles[0].x,-0.16855044899082616,delta=1e-10)
self.assertAlmostEqual(self.sim.particles[0].m,3.0404326480226416e-06,delta=1e-15)

def test_notfound(self):
with self.assertRaises(Exception):
self.sim.add("BogusPlanet",date="2000-01-01 00:00")


0 comments on commit fec16c5

Please sign in to comment.