def test_assignment(self): """ Check assignment works correctly """ assoc = A_RELEASE() assert assoc.reason == "normal" assoc.result = "affirmative" assert assoc.result == "affirmative"
def test_exceptions(self): """ Check incorrect types/values for properties raise exceptions """ assoc = A_RELEASE() with pytest.raises(AttributeError): assoc.reason = "something" with pytest.raises(ValueError): assoc.result = "accepted"
def send_release(self, is_response=False): """Send an A-RELEASE (request or response) to the peer. Parameters ---------- is_response : bool, optional ``True`` to send an A-RELEASE (response) to the peer, ``False`` to send an A-RELEASE (request) to the peer (default). """ primitive = A_RELEASE() if is_response: primitive.result = "affirmative" self.dul.send_pdu(primitive)
def send_release(assoc, is_response=False): """Send an A-RELEASE (request or response) to the peer. Parameters ---------- assoc : pynetdicom.association.Association The association that is sending the A-RELEASE. is_response : bool, optional True to send an A-RELEASE (response) to the peer, False to send an A-RELEASE (request) to the peer (default). """ primitive = A_RELEASE() if is_response: primitive.result = "affirmative" assoc.dul.send_pdu(primitive)