-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
24 lines (18 loc) · 935 Bytes
/
test.py
File metadata and controls
24 lines (18 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
import subprocess # nosec
import unittest
class TestSastScan(unittest.TestCase):
def testPositive(self):
print("############### POSITIVE TESTS ###############", flush=True)
for file in os.listdir('tests/positive'):
with self.subTest("tests/positive/{}".format(file)):
self.assertEqual(subprocess.call('docker-sast.sh'
' --target tests/positive/' + file, shell=True), 0) # nosec
def testNegative(self):
print("############### NEGATIVE TESTS ###############", flush=True)
for file in os.listdir('tests/negative'):
with self.subTest("tests/negative/{}".format(file)):
self.assertEqual(subprocess.call('docker-sast.sh'
' --target tests/negative/' + file, shell=True), 1) # nosec
if __name__ == '__main__':
unittest.main()