示例#1
0
文件: queue.py 项目: jaunis/xivo-stat
def fill_simple_calls(dao_sess, start, end):
    logger.info('Inserting simple calls...')
    stat_dao.fill_simple_calls(dao_sess, start, end)
    logger.info('Inserting answered calls...')
    stat_dao.fill_answered_calls(dao_sess, start, end)
    logger.info('Inserting leaveempty calls...')
    stat_dao.fill_leaveempty_calls(dao_sess, start, end)
示例#2
0
def fill_simple_calls(dao_sess, start, end):
    logger.info('Inserting simple calls...')
    stat_dao.fill_simple_calls(dao_sess, start, end)
    logger.info('Inserting answered calls...')
    stat_dao.fill_answered_calls(dao_sess, start, end)
    logger.info('Inserting leaveempty calls...')
    stat_dao.fill_leaveempty_calls(dao_sess, start, end)
示例#3
0
 def test_empty(self):
     start = t(1999, 1, 1)
     end = t(1999, 1, 31, 23, 59, 59, 999999)
     try:
         stat_dao.fill_simple_calls(self.session, start, end)
     except Exception:
         self.fail('fill_simple_calls failed with no data')
示例#4
0
    def test_with_specific_range(self):
        start = t(2020, 1, 1)
        end = t(2020, 1, 31, 23, 59, 59, 999999)

        stat_dao.fill_simple_calls(self.session, start, end)

        result = self.session.query(StatCallOnQueue).all()
        assert_that(result, contains(has_properties(status='full')))
示例#5
0
    def test_with_specific_timezone(self):
        # Asia/Shanghai is +08
        start = t(2020, 1, 1, 1, 0, 0, 0, tzinfo=pytz.timezone('Asia/Shanghai'))
        end = t(2020, 1, 31, 23, 59, 59, 999999)

        stat_dao.fill_simple_calls(self.session, start, end)

        result = self.session.query(StatCallOnQueue).all()
        assert_that(result, contains(has_properties(status='full')))
示例#6
0
 def test_fill_simple_calls_empty(self):
     try:
         stat_dao.fill_simple_calls(self.session, self.start, self.end)
     except:
         self.assertTrue(False, 'Should not happen')
示例#7
0
 def test_fill_simple_calls_empty(self):
     try:
         stat_dao.fill_simple_calls(self.session, self.start, self.end)
     except Exception:
         self.fail('fill_simple_calls failed with no data')