Skip to content

Commit 510ea8c

Browse files
authoredJan 6, 2025··
replace uses of pformat_all with pformat (#346)
1 parent 87bb663 commit 510ea8c

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed
 

‎kadi/commands/tests/test_commands.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def test_nsm_safe_mode_pitch_offsets_state_constraints(stop_date_2023_203):
364364
scenario=scenario,
365365
)
366366
states["pitch"].info.format = ".1f"
367-
out = states["datestart", "pitch", "pcad_mode"].pformat_all()
367+
out = states["datestart", "pitch", "pcad_mode"].pformat()
368368
exp = [
369369
" datestart pitch pcad_mode",
370370
"--------------------- ----- ---------",
@@ -638,7 +638,7 @@ def test_nsm_offset_pitch_rasl_command_events(stop_date_2024_01_30): # noqa: AR
638638

639639
out = states["datestart", "pitch", "pcad_mode"]
640640
out["pitch"].format = ".1f"
641-
assert out.pformat_all() == exp
641+
assert out.pformat() == exp
642642

643643
states = kcs.get_states(
644644
"2024:024:09:00:00",
@@ -1512,7 +1512,7 @@ def test_hrc_not_run_scenario(stop_date_2023200): # noqa: ARG001
15121512
state_keys=keys,
15131513
merge_identical=True,
15141514
)
1515-
states_out = states[["datestart"] + keys].pformat_all()
1515+
states_out = states[["datestart"] + keys].pformat()
15161516
assert states_out == states_exp
15171517

15181518
# First make the cmd_events.csv file for the scenario where F_HRC_SAFING is run at
@@ -1555,7 +1555,7 @@ def test_hrc_not_run_scenario(stop_date_2023200): # noqa: ARG001
15551555
"2023:194:23:13:52.666 OFF OFF OFF OFF",
15561556
]
15571557

1558-
states_out = states[["datestart"] + keys].pformat_all()
1558+
states_out = states[["datestart"] + keys].pformat()
15591559
assert states_out == states_exp
15601560

15611561
commands.clear_caches()
@@ -1741,4 +1741,4 @@ def test_read_backstop_with_observations():
17411741
assert obs == obs_flight
17421742

17431743
for starcat, starcat_flight in zip(starcats, starcats_cmds_flight):
1744-
assert starcat.pformat_all() == starcat_flight.pformat_all()
1744+
assert starcat.pformat() == starcat_flight.pformat()

‎kadi/commands/tests/test_states.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def test_fids_state():
468468
"2023:001:23:10:52.478 2023:001:23:10:52.734 {2, 4} fids",
469469
"2023:001:23:10:52.734 2023:002:00:00:00.000 {2, 4, 5} fids",
470470
]
471-
out = kstates["datestart", "datestop", "fids", "trans_keys"].pformat_all()
471+
out = kstates["datestart", "datestop", "fids", "trans_keys"].pformat()
472472
assert out == exp
473473

474474

@@ -1700,7 +1700,7 @@ def test_grating_motion_states():
17001700
"2021:230:00:41:19.002 2021:230:12:00:00.000 RETR RETR NONE letg",
17011701
]
17021702
# fmt: on
1703-
assert sts.pformat_all() == exp
1703+
assert sts.pformat() == exp
17041704

17051705

17061706
def test_hrc_states():
@@ -1732,7 +1732,7 @@ def test_hrc_states():
17321732
"2022:263:21:36:06.000 2022:280:00:00:00.000 OFF OFF OFF OFF hrc_15v"
17331733
]
17341734
# fmt: on
1735-
assert sts.pformat_all() == exp
1735+
assert sts.pformat() == exp
17361736

17371737

17381738
def test_hrc_states_with_scs_commanding():
@@ -1771,7 +1771,7 @@ def test_hrc_states_with_scs_commanding():
17711771
"2023:042:04:02:57.978 2023:042:08:35:28.888 ON hrc_15v",
17721772
"2023:042:08:35:28.888 2023:042:08:35:28.888 OFF hrc_15v",
17731773
]
1774-
assert sts.pformat_all() == exp
1774+
assert sts.pformat() == exp
17751775

17761776

17771777
def test_early_start_exception():
@@ -1833,7 +1833,7 @@ def test_sun_pos_mon_within_eclipse():
18331833
)
18341834

18351835
names = ["datestart"] + spm_state_keys
1836-
assert sts[names][-2:].pformat_all() == exp
1836+
assert sts[names][-2:].pformat() == exp
18371837

18381838

18391839
def test_sun_pos_mon_within_eclipse_no_spm_enab(monkeypatch):
@@ -1862,7 +1862,7 @@ def test_sun_pos_mon_within_eclipse_no_spm_enab(monkeypatch):
18621862
"2005:014:16:38:10.000 DISA 2005:014:15:31:36.410 False",
18631863
]
18641864
names = ["datestart"] + states.SPM_STATE_KEYS
1865-
assert sts[names].pformat_all() == exp
1865+
assert sts[names].pformat() == exp
18661866

18671867

18681868
def test_get_continuity_acis_cmd_requires_obsid():

‎kadi/tests/test_occweb.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def test_get_occweb_dir(str_or_Path, cache):
111111
" MAR1900E/ 2004-03-18 13:44 -",
112112
" MAR2600C/ 2002-04-30 13:38 -",
113113
]
114-
assert files_path.pformat_all() == exp
115-
assert files_url.pformat_all() == exp
114+
assert files_path.pformat() == exp
115+
assert files_url.pformat() == exp
116116

117117

118118
@pytest.mark.skipif(not HAS_OCCWEB, reason="No access to OCCweb")
@@ -137,7 +137,7 @@ def test_get_occweb_noodle(lowercase, backslash):
137137
" MAR1900E/ 2004-03-18 13:44 -",
138138
" MAR2600C/ 2002-04-30 13:38 -",
139139
]
140-
assert files_path.pformat_all() == exp
140+
assert files_path.pformat() == exp
141141

142142

143143
@pytest.mark.skipif(not HAS_OCCWEB, reason="No access to OCCweb")

0 commit comments

Comments
 (0)
Please sign in to comment.