Example #1
0
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
Example #2
0
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"
Example #3
0
def test_object_deleted_event_invalid(filename):
    with pytest.raises(InvalidEventException):
        ObjectDeletedEvent(load_resource(filename))
Example #4
0
def test_essence_unlinked_event_invalid(filename):
    with pytest.raises(InvalidEventException):
        EssenceUnlinkedEvent(load_resource(filename))
Example #5
0
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"
Example #6
0
 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"
Example #7
0
 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"
Example #8
0
 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"