From 50a09206cd2602a1d2dc962b2c3baa1625f5ddf6 Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 23 Jun 2021 18:26:51 +0200 Subject: [PATCH] PYADPT-116: add tests --- tests/test_blob.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/test_blob.py diff --git a/tests/test_blob.py b/tests/test_blob.py new file mode 100644 index 0000000..857c369 --- /dev/null +++ b/tests/test_blob.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# This file is under GNU Affero General Public License 3.0 +# see LICENSE.txt + +"""Blob unit tests.""" + +import pytest + +from . import constants +from . import model + +def test_blob_data_constructor(pEp, model): + bdata = bytes('this is test data', 'utf-8') + b = pEp.Blob(bdata) + assert(b.data == bdata) + +def test_blob_data_property(pEp, model): + b = pEp.Blob(b'dummy') + bdata = bytes('this is test data', 'utf-8') + b.data = bdata + assert(b.data == bdata)