Skip to content
Snippets Groups Projects
Commit d98e7acb authored by Ruben Verweij's avatar Ruben Verweij
Browse files

Fixes issue #25, adds unit tests and release 3.2.1

parent afa38ea0
No related branches found
No related tags found
No related merge requests found
Subproject commit e8e0d21ccc8121fc30e1296a05dadb8aa9e22efa
Subproject commit f700c239f8f9d7d1f99a3c10d9f67e2b3b8ef307
from nd2reader.reader import ND2Reader
from nd2reader.legacy import Nd2
__version__ = '3.2.0'
__version__ = '3.2.1'
from setuptools import setup
VERSION = '3.2.0'
VERSION = '3.2.1'
if __name__ == '__main__':
setup(
......
......@@ -44,9 +44,9 @@ author = 'Ruben Verweij'
# built documents.
#
# The short X.Y version.
version = '3.2.0'
version = '3.2.1'
# The full version, including alpha/beta/rc tags.
release = '3.2.0'
release = '3.2.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
import unittest
import numpy as np
import struct
from pims import Frame
from nd2reader.artificial import ArtificialND2
from nd2reader.exceptions import EmptyFileError
from nd2reader.reader import ND2Reader
......@@ -41,3 +43,26 @@ class TestReader(unittest.TestCase):
with ND2Reader('test_data/test_nd2_reader.nd2') as reader:
timesteps = reader.timesteps
self.assertEquals(len(timesteps), 0)
def test_get_frame_2D(self):
# Best test we can do for now:
# test everything up to the actual unpacking of the frame data
with ArtificialND2('test_data/test_nd2_reader.nd2') as _:
with ND2Reader('test_data/test_nd2_reader.nd2') as reader:
with self.assertRaises(struct.error) as exception:
frame = reader.get_frame_2D(c=0, t=0, z=0, x=0, y=0, v=0)
self.assertEqual(str(exception.exception), "unpack requires a buffer of 8 bytes")
def test_get_frame_vczyx(self):
# Best test we can do for now:
# test everything up to the actual unpacking of the frame data
with ArtificialND2('test_data/test_nd2_reader.nd2') as _:
with ND2Reader('test_data/test_nd2_reader.nd2') as reader:
with self.assertRaises(struct.error) as exception:
frame = reader.get_frame_vczyx(c=0, t=0, z=0, x=0, y=0, v=0)
self.assertEqual(str(exception.exception), "unpack requires a buffer of 8 bytes")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment