aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/tests/t-data.py
diff options
context:
space:
mode:
authorBen McGinnes <[email protected]>2018-08-18 10:29:14 +0000
committerBen McGinnes <[email protected]>2018-08-18 10:29:14 +0000
commit5facba45c83f7daaacc49e66306e13a35aeb74be (patch)
treebaf659036cb95f3d5c75babdc242a4629c864616 /lang/python/tests/t-data.py
parentPython bindings examples: PEP8 conpliance (diff)
downloadgpgme-5facba45c83f7daaacc49e66306e13a35aeb74be.tar.gz
gpgme-5facba45c83f7daaacc49e66306e13a35aeb74be.zip
Python bindings tests: Near PEP8 compliance
* PEP8 compliance for the vast majoeity of the tests.
Diffstat (limited to 'lang/python/tests/t-data.py')
-rwxr-xr-xlang/python/tests/t-data.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lang/python/tests/t-data.py b/lang/python/tests/t-data.py
index 5cf074c5..006c11f4 100755
--- a/lang/python/tests/t-data.py
+++ b/lang/python/tests/t-data.py
@@ -18,14 +18,15 @@
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, unicode_literals
-del absolute_import, print_function, unicode_literals
import io
import os
import tempfile
import gpg
import support
-_ = support # to appease pyflakes.
+_ = support # to appease pyflakes.
+
+del absolute_import, print_function, unicode_literals
data = gpg.Data('Hello world!')
assert data.read() == b'Hello world!'
@@ -94,7 +95,8 @@ with tempfile.NamedTemporaryFile() as tmp:
# Open using name, offset, and length.
data = gpg.Data(file=tmp.name, offset=23, length=42)
- assert data.read() == binjunk[23:23+42]
+ assert data.read() == binjunk[23:23 + 42]
+
# Test callbacks.
class DataObject(object):
@@ -118,6 +120,7 @@ class DataObject(object):
assert not self.released
self.released = True
+
do = DataObject()
cookie = object()
data = gpg.Data(cbs=(do.read, do.write, do.seek, do.release, cookie))