Exemplo n.º 1
0
    def test_to_api(self):
        call_log = Mock(date=datetime(2013, 1, 31),
                        source_name='source1',
                        source_exten='1001',
                        destination_name='',
                        destination_exten='2001',
                        user_field='',
                        answered=True,
                        duration=timedelta(seconds=2.95))

        result = mapper.to_api(call_log)

        assert_that(result, has_entries({
            'Call Date': '2013-01-31T00:00:00',
            'Caller': 'source1 (1001)',
            'Called': '2001',
            'Period': '3',
            'user Field': ''
        }))
Exemplo n.º 2
0
    def test_to_api(self):
        call_log = Mock(date=datetime(2013, 1, 31),
                        source_name='source1',
                        source_exten='1001',
                        destination_name='',
                        destination_exten='2001',
                        user_field='',
                        answered=True,
                        duration=timedelta(seconds=2.95))

        result = mapper.to_api(call_log)

        assert_that(
            result,
            has_entries({
                'Call Date': '2013-01-31T00:00:00',
                'Caller': 'source1 (1001)',
                'Called': '2001',
                'Period': '3',
                'user Field': ''
            }))
Exemplo n.º 3
0
    def test_to_api_user_field_none(self):
        call_log = Mock(duration=timedelta(seconds=0), user_field=None)

        result = mapper.to_api(call_log)

        assert_that(result, has_entry('user Field', ''))
Exemplo n.º 4
0
    def test_to_api_user_field_none(self):
        call_log = Mock(duration=timedelta(seconds=0), user_field=None)

        result = mapper.to_api(call_log)

        assert_that(result, has_entry('user Field', ''))