-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathtest_foremast_brain.py
More file actions
33 lines (27 loc) · 1.28 KB
/
test_foremast_brain.py
File metadata and controls
33 lines (27 loc) · 1.28 KB
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
import unittest
#import sys
#sys.path.append('../')
from helpers.foremastbrainhelper_test import getBaselinejson,getCurrentjson, getHistoricaljson
from prometheus.metric import convertPromesResponseToMetricInfos
from metadata.metadata import REQUEST_STATE, METRIC_PERIOD, MIN_DATA_POINTS
class Test(unittest.TestCase):
def test_convertPromesResponseToMetricInfos_historical(self):
isProphet = False
period = METRIC_PERIOD.HISTORICAL.value
djson= getHistoricaljson()
metricInfolist = convertPromesResponseToMetricInfos(djson, period, isProphet )
self.assertEqual(len(metricInfolist)>0, True)
def test_convertPromesResponseToMetricInfos_current(self):
isProphet = False
period = METRIC_PERIOD.CURRENT.value
djson= getCurrentjson()
metricInfolist = convertPromesResponseToMetricInfos(djson, period, isProphet )
self.assertEqual(len(metricInfolist)>0, True)
def test_convertPromesResponseToMetricInfos_baseline(self):
isProphet = False
period = METRIC_PERIOD.BASELINE.value
djson= getBaselinejson()
metricInfolist = convertPromesResponseToMetricInfos(djson, period, isProphet )
self.assertEqual(len(metricInfolist)>0, True)
if __name__ == "__main__":
unittest.main()