/
CAP_TicketsReport.py
47 lines (38 loc) · 1.15 KB
/
CAP_TicketsReport.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
45
46
import unittest
from RTFetcher import RTFetcher
from ConvertRawData import *
from CCSReportGenerator import SupportTicketsReportGenerator
import logging
from time import time
class CAP_TicketsReport():
"""docstring for CAP_TicketsReport"""
def run(self):
l_f=RTFetcher()
l_f.login()
l_f.fetch(a_from='2013-10-20')
l_f.savetofile()
l_c=RawDateConverter()
l_c.generate_local_file(get_date_with_offset(-7))
logging.debug("file process done")
l_g = SupportTicketsReportGenerator()
l_g.run()
class _UT(unittest.TestCase):
"""unit test of CAP_TicketsReport"""
def testOne(self):
l_fn="Results_"+ str(time()) +".csv"
l_f=RTFetcher()
l_f.login()
l_f.fetch(a_from='2013-10-20')
# l_f.save(l_fn)
l_f.savetofile()
l_c=RawDateConverter()
# l_c.get_raw_data(l_fn)
l_c.generate_local_file(get_date_with_offset(-7))
logging.debug("file process done")
l_g = SupportTicketsReportGenerator()
l_g.run()
def main():
report = CAP_TicketsReport()
report.run()
if __name__ == '__main__':
main()