test_baseio.py 685 B

12345678910111213141516171819202122232425
  1. """
  2. Tests of neo.io.baseio
  3. """
  4. import unittest
  5. from neo.core import objectlist
  6. from neo.io.baseio import BaseIO
  7. class TestIOObjects(unittest.TestCase):
  8. def test__raise_error_when_not_readable_or_writable(self):
  9. reader = BaseIO()
  10. for ob in objectlist:
  11. if ob not in BaseIO.readable_objects:
  12. meth = getattr(reader, 'read_' + ob.__name__.lower())
  13. self.assertRaises(AssertionError, meth, )
  14. if ob not in BaseIO.writeable_objects:
  15. meth = getattr(reader, 'write_' + ob.__name__.lower())
  16. self.assertRaises(AssertionError, meth, ())
  17. if __name__ == "__main__":
  18. unittest.main()