示例#1
0
    def test_find_all_outgoing_calls_for_phone_no_calls(self):
        identity = "sip/131313"
        limit = 10

        result = call_log_dao.find_all_outgoing_for_phone(identity, limit)

        assert_that(result, has_length(0))
示例#2
0
    def test_find_all_outgoing_calls_for_phone_no_calls(self):
        identity = "sip/131313"
        limit = 10

        result = call_log_dao.find_all_outgoing_for_phone(identity, limit)

        assert_that(result, has_length(0))
示例#3
0
    def test_find_all_outgoing_for_phone_limited(self):
        identity = "sip/131313"
        limit = 2
        call_logs = _, call_log_1, call_log_2, call_log_3, _ = (self._mock_call_log(),
                                                                self._mock_call_log(date=datetime(2015, 1, 1, 13), source_line_identity=identity),
                                                                self._mock_call_log(date=datetime(2011, 1, 1, 13), source_line_identity=identity),
                                                                self._mock_call_log(date=datetime(2015, 2, 1, 13), source_line_identity=identity),
                                                                self._mock_call_log())

        call_log_dao.create_from_list(call_logs)

        result = call_log_dao.find_all_outgoing_for_phone(identity, limit)

        assert_that(result, has_length(2))
        assert_that(result[0].date, equal_to(call_log_3.date))
        assert_that(result[1].date, equal_to(call_log_1.date))
        assert_that(result[0].source_line_identity, equal_to(call_log_3.source_line_identity))
        assert_that(result[1].source_line_identity, equal_to(call_log_1.source_line_identity))
示例#4
0
    def test_find_all_outgoing_for_phone_limited(self):
        identity = "sip/131313"
        limit = 2
        call_logs = _, call_log_1, call_log_2, call_log_3, _ = (
            self._mock_call_log(),
            self._mock_call_log(date=datetime(2015, 1, 1, 13),
                                source_line_identity=identity),
            self._mock_call_log(date=datetime(2011, 1, 1, 13),
                                source_line_identity=identity),
            self._mock_call_log(date=datetime(2015, 2, 1, 13),
                                source_line_identity=identity),
            self._mock_call_log())

        call_log_dao.create_from_list(call_logs)

        result = call_log_dao.find_all_outgoing_for_phone(identity, limit)

        assert_that(result, has_length(2))
        assert_that(result[0].date, equal_to(call_log_3.date))
        assert_that(result[1].date, equal_to(call_log_1.date))
        assert_that(result[0].source_line_identity,
                    equal_to(call_log_3.source_line_identity))
        assert_that(result[1].source_line_identity,
                    equal_to(call_log_1.source_line_identity))
示例#5
0
def outgoing_calls_for_phone(identifier, limit):
    call_logs = call_log_dao.find_all_outgoing_for_phone(identifier, limit)
    return _convert_outgoing_call_logs(call_logs)
示例#6
0
def outgoing_calls_for_phone(identifier, limit):
    call_logs = call_log_dao.find_all_outgoing_for_phone(identifier, limit)
    return _convert_outgoing_call_logs(call_logs)