Skip to content

Commit 313fa77

Browse files
committed
some renaming
1 parent 0a11880 commit 313fa77

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/spacepackets/ecss/pus_1_verification.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __repr__(self):
6969

7070

7171
@dataclass
72-
class VerificationManagedParams:
72+
class ManagedParamsVerification:
7373
bytes_step_id: int = 1
7474
bytes_err_code: int = 1
7575

@@ -161,15 +161,15 @@ def __empty(cls) -> Service1Tm:
161161
return cls(apid=0, subservice=Subservice.INVALID, timestamp=b"")
162162

163163
@classmethod
164-
def from_tm(cls, tm: PusTm, verif_params: VerificationManagedParams) -> Service1Tm:
164+
def from_tm(cls, tm: PusTm, verif_params: ManagedParamsVerification) -> Service1Tm:
165165
service_1_tm = cls.__empty()
166166
service_1_tm.pus_tm = tm
167167
cls._unpack_raw_tm(service_1_tm, verif_params)
168168
return service_1_tm
169169

170170
@classmethod
171171
def unpack(
172-
cls, data: bytes, managed_params: ManagedParams, verif_params: VerificationManagedParams
172+
cls, data: bytes, managed_params: ManagedParams, verif_params: ManagedParamsVerification
173173
) -> Service1Tm:
174174
"""Parse a service 1 telemetry packet.
175175
@@ -218,7 +218,7 @@ def source_data(self) -> bytes:
218218
return self.pus_tm.source_data
219219

220220
@classmethod
221-
def _unpack_raw_tm(cls, instance: Service1Tm, params: VerificationManagedParams) -> None:
221+
def _unpack_raw_tm(cls, instance: Service1Tm, params: ManagedParamsVerification) -> None:
222222
tm_data = instance.pus_tm.tm_data
223223
if len(tm_data) < 4:
224224
raise TmSrcDataTooShortError(4, len(tm_data))
@@ -228,7 +228,7 @@ def _unpack_raw_tm(cls, instance: Service1Tm, params: VerificationManagedParams)
228228
else:
229229
instance._unpack_success_verification(params)
230230

231-
def _unpack_failure_verification(self, unpack_cfg: VerificationManagedParams) -> None:
231+
def _unpack_failure_verification(self, unpack_cfg: ManagedParamsVerification) -> None:
232232
"""Handle parsing a verification failure packet, subservice ID 2, 4, 6 or 8"""
233233
tm_data = self.pus_tm.tm_data
234234
subservice = self.pus_tm.subservice
@@ -249,7 +249,7 @@ def _unpack_failure_verification(self, unpack_cfg: VerificationManagedParams) ->
249249
tm_data[current_idx:], unpack_cfg.bytes_err_code, len(tm_data) - current_idx
250250
)
251251

252-
def _unpack_success_verification(self, unpack_cfg: VerificationManagedParams) -> None:
252+
def _unpack_success_verification(self, unpack_cfg: ManagedParamsVerification) -> None:
253253
if self.pus_tm.subservice == Subservice.TM_STEP_SUCCESS:
254254
try:
255255
self._verif_params.step_id = StepId.unpack(

tests/ecss/test_srv1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Service1Tm,
1111
StepId,
1212
Subservice,
13-
VerificationManagedParams,
13+
ManagedParamsVerification,
1414
VerificationParams,
1515
create_acceptance_failure_tm,
1616
create_acceptance_success_tm,
@@ -46,7 +46,7 @@ def test_basic(self):
4646
self.assertEqual(self.srv1_tm.error_code, None)
4747

4848
def test_other_ctor(self):
49-
srv1_tm = Service1Tm.from_tm(self.srv1_tm.pus_tm, VerificationManagedParams())
49+
srv1_tm = Service1Tm.from_tm(self.srv1_tm.pus_tm, ManagedParamsVerification())
5050
self.assertEqual(srv1_tm, self.srv1_tm)
5151

5252
def test_failure_notice(self):
@@ -148,7 +148,7 @@ def _test_srv_1_success_tm(
148148
self.assertEqual(srv_1_tm.tc_req_id.tc_psc, pus_tc.packet_seq_control)
149149
srv_1_tm_raw = srv_1_tm.pack()
150150
srv_1_tm_unpacked = Service1Tm.unpack(
151-
srv_1_tm_raw, ManagedParams(len(TEST_STAMP)), VerificationManagedParams()
151+
srv_1_tm_raw, ManagedParams(len(TEST_STAMP)), ManagedParamsVerification()
152152
)
153153
self.assertEqual(srv_1_tm_unpacked.tc_req_id.tc_packet_id.raw(), pus_tc.packet_id.raw())
154154
self.assertEqual(srv_1_tm_unpacked.tc_req_id.tc_psc.raw(), pus_tc.packet_seq_control.raw())
@@ -220,7 +220,7 @@ def _test_srv_1_failure_comparison_helper(
220220
self.assertEqual(srv_1_tm.tc_req_id.tc_packet_id, pus_tc.packet_id)
221221
self.assertEqual(srv_1_tm.tc_req_id.tc_psc, pus_tc.packet_seq_control)
222222
srv_1_tm_raw = srv_1_tm.pack()
223-
unpack_params = VerificationManagedParams()
223+
unpack_params = ManagedParamsVerification()
224224
if failure_notice is not None:
225225
unpack_params.bytes_err_code = failure_notice.code.len()
226226
if step_id is not None:

0 commit comments

Comments
 (0)