Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_common
Commits
26cd1b2f
Commit
26cd1b2f
authored
Jun 08, 2024
by
BO ZHANG
🏀
Browse files
add delete_section
parent
0da320ef
Pipeline
#5412
passed with stage
in 0 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
tests/test_fits_header_ops.py
View file @
26cd1b2f
...
@@ -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
.
a
dd_comment
(
"A"
)
h
.
a
ppend
((
"COMMENT"
,
"A"
,
""
),
bottom
=
True
)
h
.
a
dd_comment
(
"B"
)
h
.
a
ppend
((
"COMMENT"
,
"C"
,
""
),
bottom
=
True
)
h
.
a
dd_comment
(
"C"
)
h
.
a
ppend
((
"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
.
a
dd_comment
(
"======"
)
h
.
a
ppend
((
"COMMENT"
,
"="
*
72
,
""
),
bottom
=
True
)
h
.
a
dd_comment
(
"WCS"
)
h
.
a
ppend
((
"COMMENT"
,
"WCS"
,
""
),
bottom
=
True
)
h
.
a
dd_comment
(
"======"
)
h
.
a
ppend
((
"COMMENT"
,
"="
*
72
,
""
),
bottom
=
True
)
h
.
set
(
"A"
,
1
)
h
.
append
((
"A"
,
1
,
""
),
bottom
=
True
)
h
.
a
dd_comment
(
"======"
)
h
.
a
ppend
((
"COMMENT"
,
"="
*
72
,
""
),
bottom
=
True
)
h
.
a
dd_comment
(
"======"
)
h
.
a
ppend
((
"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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment