From 8a06aebdfe0f64db07ebc5784312e0bdef9777d8 Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Fri, 11 Aug 2023 18:06:14 -0400 Subject: [PATCH] add test for get_rawio_class --- neo/test/rawiotest/test_get_rawio.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 neo/test/rawiotest/test_get_rawio.py diff --git a/neo/test/rawiotest/test_get_rawio.py b/neo/test/rawiotest/test_get_rawio.py new file mode 100644 index 000000000..3f3e7f6a5 --- /dev/null +++ b/neo/test/rawiotest/test_get_rawio.py @@ -0,0 +1,27 @@ +from neo.rawio import get_rawio_class +from pathlib import Path +from tempfile import TemporaryDirectory + + +def test_get_rawio_class(): + # use plexon io suffix for testing here + non_existant_file = Path('non_existant_folder/non_existant_file.plx') + non_existant_file.unlink(missing_ok=True) + ios = get_rawio_class(non_existant_file) + + assert ios + + # cleanup + non_existant_file.unlink(missing_ok=True) + + +def test_get_rawio_class_nonsupported_rawio(): + + non_existant_file = Path('non_existant_folder/non_existant_file.fake') + non_existant_file.unlink(missing_ok=True) + ios = get_rawio_class(non_existant_file) + + assert ios is None + + # cleanup + non_existant_file.unlink(missing_ok=True)