From 6a715e199d15ec539482544cb48afe2d5ebfebc5 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Thu, 24 Jun 2021 11:19:20 +0200 Subject: [PATCH] PYADPT-116: Add more test-cases. --- tests/test_blob.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_blob.py b/tests/test_blob.py index 89b666c..b4df272 100644 --- a/tests/test_blob.py +++ b/tests/test_blob.py @@ -9,6 +9,8 @@ def test_blob_data_constructor(pEp): bdata = b'this is binary \x00\x01\xbb\xa7\xa4\xab test data' b = pEp.Blob(bdata) assert b.data == bdata + assert not b.mime_type + assert not b.filename def test_blob_data_property(pEp): @@ -16,3 +18,14 @@ def test_blob_data_property(pEp): b = pEp.Blob(b'dummy') b.data = bdata assert b.data == bdata + assert not b.mime_type + assert not b.filename + + +def test_blob_data_property_keeps_other_fields(pEp): + bdata = b'this is binary \x00\x01\xbb\xa7\xa4\xab test data' + b = pEp.Blob(b'dummy', 'application/x-mydata', 'myfile.dat') + b.data = bdata + assert b.data == bdata + assert b.mime_type == 'application/x-mydata' + assert b.filename == 'myfile.dat'