Commit 26cd1b2f authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

add delete_section

parent 0da320ef
Pipeline #5412 passed with stage
in 0 seconds
......@@ -104,17 +104,17 @@ class TestFitsHeaderOps(unittest.TestCase):
def test_delete_section(self):
h = fits.Header()
h.add_comment("A")
h.add_comment("B")
h.add_comment("C")
h.set("SIMPLE", True)
h.set("NAXIS1", 1)
h.add_comment("======")
h.add_comment("WCS")
h.add_comment("======")
h.set("A", 1)
h.add_comment("======")
h.add_comment("======")
h.append(("COMMENT", "A", ""), bottom=True)
h.append(("COMMENT", "C", ""), bottom=True)
h.append(("COMMENT", "B", ""), bottom=True)
h.append(("SIMPLE", True, ""), bottom=True)
h.append(("NAXIS1", 1, ""), bottom=True)
h.append(("COMMENT", "=" * 72, ""), bottom=True)
h.append(("COMMENT", "WCS", ""), bottom=True)
h.append(("COMMENT", "=" * 72, ""), bottom=True)
h.append(("A", 1, ""), bottom=True)
h.append(("COMMENT", "=" * 72, ""), bottom=True)
h.append(("COMMENT", "=" * 72, ""), bottom=True)
h_del = delete_section(h, title="WCS")
self.assertEqual(len(h_del.cards), 7)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment