def test_essence_linked_wrong_type(): with pytest.raises(InvalidEventException) as error: EssenceLinkedEvent(load_resource("essenceUnlinkedEvent.xml")) assert EssenceLinkedEvent.root_tag in error.value.message
def test_object_deleted_event_valid(): event = ObjectDeletedEvent(load_resource("objectDeletedEvent.xml")) assert event.timestamp == "2019-09-24T17:21:28.787+02:00" assert event.media_id == "media id"
def test_object_deleted_event_invalid(filename): with pytest.raises(InvalidEventException): ObjectDeletedEvent(load_resource(filename))
def test_essence_unlinked_event_invalid(filename): with pytest.raises(InvalidEventException): EssenceUnlinkedEvent(load_resource(filename))
def test_essence_unlinked_event_valid(): event = EssenceUnlinkedEvent(load_resource("essenceUnlinkedEvent.xml")) assert event.timestamp == "2019-09-24T17:21:28.787+02:00" assert event.media_id == "media id"
def test_parse_event(self, handler): event = load_resource("objectDeletedEvent.xml") event = handler._parse_event(event) assert event is not None assert event.media_id == "media id"
def test_parse_event(self, handler): event = load_resource("essenceUnlinkedEvent.xml") event = handler._parse_event(event) assert event is not None assert event.media_id == "media id"
def test_parse_event(self, handler): event = load_resource("essenceLinkedEvent.xml") event = handler._parse_event(event) assert event is not None assert event.file == "file.mxf"