예제 #1
0
    def test_attribute_list(self):
        """Test Event.attribute_list."""
        request = N_CREATE()
        request.AttributeList = self.bytestream
        event = Event(None, evt.EVT_N_CREATE, {
            'request': request,
            'context': self.context.as_tuple
        })

        assert event._hash is None
        assert event._decoded is None
        ds = event.attribute_list
        assert event._hash == hash(request.AttributeList)
        assert isinstance(ds, Dataset)
        assert ds.PatientName == 'TEST^Test'

        ds.PatientID = '1234567'
        assert event.attribute_list.PatientID == '1234567'

        # Test hash mismatch
        event._hash = None
        assert 'PatientID' not in event.attribute_list
예제 #2
0
    def test_attribute_list(self):
        """Test Event.attribute_list."""
        request = N_CREATE()
        request.AttributeList = self.bytestream
        event = Event(
            None,
            evt.EVT_N_CREATE,
            {"request": request, "context": self.context.as_tuple},
        )

        assert event._hash is None
        assert event._decoded is None
        ds = event.attribute_list
        assert event._hash == hash(request.AttributeList)
        assert isinstance(ds, Dataset)
        assert ds.PatientName == "TEST^Test"

        ds.PatientID = "1234567"
        assert event.attribute_list.PatientID == "1234567"

        # Test hash mismatch
        event._hash = None
        assert "PatientID" not in event.attribute_list