Commit 13b14bf5 authored by Martin Reinecke's avatar Martin Reinecke

try to improve serialization test

parent d330fcc4
Pipeline #12525 canceled with stage
in 57 seconds
...@@ -21,31 +21,18 @@ import unittest ...@@ -21,31 +21,18 @@ import unittest
from numpy.testing import assert_equal from numpy.testing import assert_equal
from keepers import Repository from keepers import Repository
from test.common import expand, generate_spaces from test.common import expand, generate_spaces
from nose.plugins.skip import SkipTest
import os import os
#try: class SpaceSerializationTests(unittest.TestCase):
import h5py @expand([[space] for space in generate_spaces()])
#except ImportError: def test_serialization(self, space):
# h5py_available = False try:
#else: import h5py
# h5py_available = True except ImportError:
raise SkipTest
if h5py_available: repo = Repository('test.h5')
class SpaceSerializationTests(unittest.TestCase): repo.add(space, 'space')
# variable to hold the repository repo.commit()
_repo = None assert_equal(space, self._repo.get('space'))
os.remove('test.h5')
@classmethod
def setUpClass(cls):
cls._repo = Repository('test.h5')
@expand([[space] for space in generate_spaces()])
def test_serialization(self, space):
self._repo.add(space, 'space')
self._repo.commit()
assert_equal(space, self._repo.get('space'))
@classmethod
def tearDownClass(cls):
os.remove('test.h5')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment