-
Notifications
You must be signed in to change notification settings - Fork 3
/
test_ess.py
44 lines (38 loc) · 1.28 KB
/
test_ess.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import unittest
import json
import time
import ess
class TestFlaskApi(unittest.TestCase):
api_version = 'r4'
def setUp(self):
self.app = ess.app.test_client()
self.app.testing = True
def test_get_scripts(self):
response = self.app.get('/gui/scripts.js')
data = response.get_data()
self.assertEqual(response.status_code, 200)
def test_load_gui(self):
response = self.app.get('/')
data = response.get_data()
self.assertTrue("ElasTest Security Service" in data)
def test_get_webgui(self):
response = self.app.get('/gui/')
data = response.get_data()
self.assertTrue("ElasTest Security Service" in data)
def test_get_health(self):
response = self.app.get('/health/')
data = response.get_data()
self.assertTrue("ZAP is Ready" in data)
def test_get_tjob_stat(self):
response = self.app.get('/ess/tjob/execstatus/')
data = response.get_data()
self.assertTrue("called" in data)
"""
def test_get_ess_stat(self):
response = self.app.get('/ess/api/'+self.api_version+'/status/')
data = response.get_data()
print(data)
self.assertTrue("not-yet" in data)
"""
if __name__ == "__main__":
unittest.main()