Skip to content

Commit

Permalink
Updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
jellis18 committed Mar 25, 2021
1 parent f35c2a3 commit d46f2e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enterprise/pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,5 +573,5 @@ def Pulsar(*args, **kwargs):
t2pulsar = t2.tempopulsar(relparfile, reltimfile, maxobs=maxobs, ephem=ephem, clk=clk)
os.chdir(cwd)
return Tempo2Pulsar(t2pulsar, sort=sort, drop_t2pulsar=drop_t2pulsar, planets=planets)
else:
logger.error("Unknown arguments {}".format(args)) # pragma: no cover

raise ValueError("Unknown arguments {}".format(args))
6 changes: 6 additions & 0 deletions tests/test_pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ def test_wrong_input(self):
msg = "Cannot find parfile wrong.par or timfile wrong.tim!"
self.assertTrue(msg in context.exception)

def test_value_error(self):
"""Test exception when unknown argument is given"""

with self.assertRaises(ValueError):
Pulsar(datadir + "/B1855+09_NANOGrav_9yv1.gls.par", datadir + "/B1855+09_NANOGrav_9yv1.time")


class TestPulsarPint(TestPulsar):
@classmethod
Expand Down

0 comments on commit d46f2e5

Please sign in to comment.