Skip to content

Commit

Permalink
updated changes and added test for new code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Torres committed Jul 17, 2019
1 parent 98c38d0 commit ce15f01
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

- Created dedicated documentation for rtd
- Fixed bug where return was missing
- GoodmanFocus need to be instantiated only once [#19]
- Argument --file-pattern is now actually used in file selection [#18]
- Eliminated some warnings

0.2.0
=====
Expand Down
14 changes: 14 additions & 0 deletions goodman_focus/tests/test_goodman_focus.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def setUp(self):
ccd = CCDData(data=np.ones((100, 1000)),
meta=fits.Header(),
unit='adu')
ccd.header['instconf'] = 'Red'
ccd.header['obstype'] = 'FOCUS'
ccd.header['cam_foc'] = self.focus_values[i]
ccd.header['cam_targ'] = 0
Expand Down Expand Up @@ -190,6 +191,19 @@ def test__call__Moffat1D(self):
self.goodman_focus()
self.assertIsNotNone(self.goodman_focus.fwhm)

def test__call__with_list(self):
self.assertIsNone(self.goodman_focus.fwhm)
result = self.goodman_focus(files=self.file_list)
self.assertIsNotNone(self.goodman_focus.fwhm)

def test__call__list_file_no_exist(self):
file_list = ["no_file_{}.fits".format(i) for i in range(10, 20)]
self.assertRaises(SystemExit, self.goodman_focus, file_list)

def test__call__not_a_list(self):
_string = 'not a list'
self.assertRaises(SystemExit, self.goodman_focus, _string)

def tearDown(self):
for _file in self.file_list:
os.unlink(_file)
Expand Down

0 comments on commit ce15f01

Please sign in to comment.