예제 #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')