Skip to content

Commit

Permalink
improved code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
deichmab-draeger committed Oct 4, 2023
1 parent d6937f6 commit 1a148d9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
26 changes: 25 additions & 1 deletion tests/70041_MDIB_Final.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,31 @@
<pm:ConceptDescription Lang="en-US">Normal</pm:ConceptDescription>
</pm:Type>
</pm:AlertSignal>


<pm:AlertSignal Handle="0xD3C00100.loc.Aud" DescriptorVersion="2" SafetyClassification="MedA" ConditionSignaled="0xD3C00100" Manifestation="Aud" Latching="false">
<ext:Extension>
<msg:Retrievability>
<msg:By Method="Get"/>
<msg:By Method="Ep"/>
</msg:Retrievability>
</ext:Extension>
<pm:Type Code="194088">
<pm:ConceptDescription Lang="en-US">Normal</pm:ConceptDescription>
</pm:Type>
</pm:AlertSignal>

<pm:AlertSignal Handle="0xD3C00100.loc.Aud2" DescriptorVersion="2" SafetyClassification="MedA" ConditionSignaled="0xD3C00100" Manifestation="Aud" Latching="false" AcknowledgementSupported="true">
<ext:Extension>
<msg:Retrievability>
<msg:By Method="Get"/>
<msg:By Method="Ep"/>
</msg:Retrievability>
</ext:Extension>
<pm:Type Code="194088">
<pm:ConceptDescription Lang="en-US">Normal</pm:ConceptDescription>
</pm:Type>
</pm:AlertSignal>

</pm:AlertSystem>
<pm:Sco Handle="Sco.mds0" DescriptorVersion="2">
<ext:Extension>
Expand Down
8 changes: 7 additions & 1 deletion tests/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ def test_audio_pause(self):
"""Tests AudioPauseProvider
"""
# switch one alert system off
alert_system_off = 'Asy.3208'
with self.sdc_device.mdib.transaction_manager() as mgr:
state = mgr.get_state(alert_system_off)
state.ActivationState = pm_types.AlertActivation.OFF
alert_system_descriptors = self.sdc_device.mdib.descriptions.NODETYPE.get(pm.AlertSystemDescriptor)
self.assertTrue(alert_system_descriptors is not None)
self.assertGreater(len(alert_system_descriptors), 0)
Expand All @@ -314,7 +319,8 @@ def test_audio_pause(self):
for alert_system_descriptor in alert_system_descriptors:
state = self.sdc_client.mdib.states.descriptor_handle.get_one(alert_system_descriptor.Handle)
# we know that the state has only one SystemSignalActivation entity, which is audible and should be paused now
self.assertEqual(state.SystemSignalActivation[0].State, pm_types.AlertActivation.PAUSED)
if alert_system_descriptor.Handle != alert_system_off:
self.assertEqual(state.SystemSignalActivation[0].State, pm_types.AlertActivation.PAUSED)

coding = pm_types.Coding(NomenclatureCodes.MDC_OP_SET_CANCEL_ALARMS_AUDIO_PAUSE)
operation = self.sdc_device.mdib.descriptions.coding.get_one(coding)
Expand Down

0 comments on commit 1a148d9

Please sign in to comment.