From 3ab8a0be6016badd6651c341e6ae4b088da84af8 Mon Sep 17 00:00:00 2001 From: Wes Date: Tue, 13 Dec 2022 16:29:18 +0000 Subject: [PATCH] Update tests to account for change in 'file_path' value verification --- .../analyzers/localfile/localfile_test.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/salt/sensoroni/files/analyzers/localfile/localfile_test.py b/salt/sensoroni/files/analyzers/localfile/localfile_test.py index 154b74cd7..f2becac1f 100644 --- a/salt/sensoroni/files/analyzers/localfile/localfile_test.py +++ b/salt/sensoroni/files/analyzers/localfile/localfile_test.py @@ -28,22 +28,6 @@ class TestLocalfileMethods(unittest.TestCase): mock.assert_called_once() lcmock.assert_called_once() - def test_checkConfigRequirements_present(self): - conf = {"file_path": "['intel.csv']"} - self.assertTrue(localfile.checkConfigRequirements(conf)) - - def test_checkConfigRequirements_not_present(self): - conf = {"not_a_file_path": "blahblah"} - with self.assertRaises(SystemExit) as cm: - localfile.checkConfigRequirements(conf) - self.assertEqual(cm.exception.code, 126) - - def test_checkConfigRequirements_empty(self): - conf = {"file_path": ""} - with self.assertRaises(SystemExit) as cm: - localfile.checkConfigRequirements(conf) - self.assertEqual(cm.exception.code, 126) - def test_searchFile_multiple_found(self): artifact = "abcd1234" results = localfile.searchFile(artifact, ["localfile_test.csv"]) @@ -115,7 +99,7 @@ class TestLocalfileMethods(unittest.TestCase): } ] artifactInput = '{"value":"foo","artifactType":"url"}' - conf = {"file_path": "/home/intel.csv"} + conf = {"file_path": ['/home/intel.csv']} with patch('localfile.localfile.searchFile', new=MagicMock(return_value=output)) as mock: results = localfile.analyze(conf, artifactInput) self.assertEqual(results["summary"], "suspicious")