From e3cee2ca27db657b8229246ac5b5e7b9db7cffa9 Mon Sep 17 00:00:00 2001 From: Stuart Read Date: Thu, 9 Sep 2021 15:51:50 -0600 Subject: [PATCH] test_preprocess: Preprocessors should not crash when samples have one attr --- orangecontrib/spectroscopy/tests/test_preprocess.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/orangecontrib/spectroscopy/tests/test_preprocess.py b/orangecontrib/spectroscopy/tests/test_preprocess.py index 5abeb15e4..851e8cf9d 100644 --- a/orangecontrib/spectroscopy/tests/test_preprocess.py +++ b/orangecontrib/spectroscopy/tests/test_preprocess.py @@ -421,6 +421,15 @@ def test_no_attributes(self): for proc in PREPROCESSORS: _ = proc(data) + def test_one_attribute(self): + """ Preprocessors should not crash when samples have one attribute. """ + data = SMALL_COLLAGEN + data = data.transform(Orange.data.Domain([data.domain.attributes[0]], + class_vars=data.domain.class_vars, + metas=data.domain.metas)) + for proc in PREPROCESSORS: + _ = proc(data) + def test_all_nans(self): """ Preprocessors should not crash when there are all-nan samples. """ for proc in PREPROCESSORS: