From a22efbde377d23b0c05ad8ecdee06bd4e226c0fb Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Sun, 24 Jul 2022 23:00:36 +0300 Subject: [PATCH] test: add abstract cloudevent coverage tests Signed-off-by: Alexander Tkachev --- cloudevents/tests/test_abstract_cloudevent.py | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 cloudevents/tests/test_abstract_cloudevent.py diff --git a/cloudevents/tests/test_abstract_cloudevent.py b/cloudevents/tests/test_abstract_cloudevent.py new file mode 100644 index 0000000..06c5cce --- /dev/null +++ b/cloudevents/tests/test_abstract_cloudevent.py @@ -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