Browse Source

PYADPT-116: Add more test-cases.

pull/5/head
Hartmut Goebel 7 months ago
parent
commit
6a715e199d
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      tests/test_blob.py

+ 13
- 0
tests/test_blob.py View File

@ -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'

Loading…
Cancel
Save