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): ...@@ -104,17 +104,17 @@ class TestFitsHeaderOps(unittest.TestCase):
def test_delete_section(self): def test_delete_section(self):
h = fits.Header() h = fits.Header()
h.add_comment("A") h.append(("COMMENT", "A", ""), bottom=True)
h.add_comment("B") h.append(("COMMENT", "C", ""), bottom=True)
h.add_comment("C") h.append(("COMMENT", "B", ""), bottom=True)
h.set("SIMPLE", True) h.append(("SIMPLE", True, ""), bottom=True)
h.set("NAXIS1", 1) h.append(("NAXIS1", 1, ""), bottom=True)
h.add_comment("======") h.append(("COMMENT", "=" * 72, ""), bottom=True)
h.add_comment("WCS") h.append(("COMMENT", "WCS", ""), bottom=True)
h.add_comment("======") h.append(("COMMENT", "=" * 72, ""), bottom=True)
h.set("A", 1) h.append(("A", 1, ""), bottom=True)
h.add_comment("======") h.append(("COMMENT", "=" * 72, ""), bottom=True)
h.add_comment("======") h.append(("COMMENT", "=" * 72, ""), bottom=True)
h_del = delete_section(h, title="WCS") h_del = delete_section(h, title="WCS")
self.assertEqual(len(h_del.cards), 7) 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