From 98a1fb96c21c2f9cfefd4d0599c5a618393217b6 Mon Sep 17 00:00:00 2001 From: Wes Date: Tue, 13 Dec 2022 16:23:16 +0000 Subject: [PATCH] Add test coverage for empty list value --- salt/sensoroni/files/analyzers/helpers_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/sensoroni/files/analyzers/helpers_test.py b/salt/sensoroni/files/analyzers/helpers_test.py index 0acb18d29..86d05a8bb 100644 --- a/salt/sensoroni/files/analyzers/helpers_test.py +++ b/salt/sensoroni/files/analyzers/helpers_test.py @@ -38,3 +38,9 @@ class TestHelpersMethods(unittest.TestCase): conf = {"file_path": ['testfile.csv']} path = 'file_path' self.assertTrue(conf, path) + + def test_verifyNonEmptyListValueIsEmpty(self): + conf = {"file_path": ""} + with self.assertRaises(SystemExit) as cm: + helpers.verifyNonEmptyListValue(conf, 'file_path') + self.assertEqual(cm.exception.code, 126)