Skip to content

Commit

Permalink
Add more test coverage for 'close' method of AsdfInFits
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella committed Jun 12, 2017
1 parent f4519f2 commit dd93352
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions asdf/tests/test_fits_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ def test_asdf_in_fits_open(tmpdir):
with fits_embed.AsdfInFits.open(tmpfile) as ff:
compare_asdfs(asdf_in_fits, ff)

# Test open/close without context handler
ff = fits_embed.AsdfInFits.open(tmpfile)
compare_asdfs(asdf_in_fits, ff)
ff.close()

# Test reading in the file from an already-opened file handle
with open(tmpfile, 'rb') as handle:
with fits_embed.AsdfInFits.open(handle) as ff:
Expand All @@ -199,6 +204,11 @@ def test_asdf_open(tmpdir):
with asdf_open(tmpfile) as ff:
compare_asdfs(asdf_in_fits, ff)

# Test open/close without context handler
ff = asdf_open(tmpfile)
compare_asdfs(asdf_in_fits, ff)
ff.close()

# Test reading in the file from an already-opened file handle
with open(tmpfile, 'rb') as handle:
with asdf_open(handle) as ff:
Expand Down

0 comments on commit dd93352

Please sign in to comment.