test: add abstract cloudevent coverage tests

Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com>
This commit is contained in:
Alexander Tkachev 2022-07-24 23:00:36 +03:00
parent 2b3c0f1292
commit a22efbde37
1 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,41 @@
from cloudevents.abstract import CloudEvent
import pytest
def test_del_is_abstract():
"""
exists mainly for coverage reasons
"""
with pytest.raises(TypeError):
del CloudEvent()["a"]
def test_set_is_abstract():
"""
exists mainly for coverage reasons
"""
with pytest.raises(TypeError):
CloudEvent()["a"] = 2
def test_create_is_abstract():
"""
exists mainly for coverage reasons
"""
assert CloudEvent.create({}, None) is None
def test_data_read_is_abstract():
"""
exists mainly for coverage reasons
"""
with pytest.raises(TypeError):
CloudEvent()._data_read_model
def test_attributes_read_model_is_abstract():
"""
exists mainly for coverage reasons
"""
with pytest.raises(TypeError):
CloudEvent()._attributes_read_model