Add new test for list value verification function

This commit is contained in:
Wes
2022-12-13 16:28:22 +00:00
parent 5422c5b3e2
commit 117d230b9d

View File

@@ -33,3 +33,14 @@ class TestHelpersMethods(unittest.TestCase):
data = helpers.parseArtifact(input)
self.assertEqual(data["artifactType"], "bar")
self.assertEqual(data["value"], "foo")
def test_verifyNonEmptyListValue(self):
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)