Skip to content

Commit a22efbd

Browse files
committed
test: add abstract cloudevent coverage tests
Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com>
1 parent 2b3c0f1 commit a22efbd

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from cloudevents.abstract import CloudEvent
2+
import pytest
3+
4+
5+
def test_del_is_abstract():
6+
"""
7+
exists mainly for coverage reasons
8+
"""
9+
with pytest.raises(TypeError):
10+
del CloudEvent()["a"]
11+
12+
13+
def test_set_is_abstract():
14+
"""
15+
exists mainly for coverage reasons
16+
"""
17+
with pytest.raises(TypeError):
18+
CloudEvent()["a"] = 2
19+
20+
21+
def test_create_is_abstract():
22+
"""
23+
exists mainly for coverage reasons
24+
"""
25+
assert CloudEvent.create({}, None) is None
26+
27+
28+
def test_data_read_is_abstract():
29+
"""
30+
exists mainly for coverage reasons
31+
"""
32+
with pytest.raises(TypeError):
33+
CloudEvent()._data_read_model
34+
35+
36+
def test_attributes_read_model_is_abstract():
37+
"""
38+
exists mainly for coverage reasons
39+
"""
40+
with pytest.raises(TypeError):
41+
CloudEvent()._attributes_read_model

0 commit comments

Comments
 (0)