示例#1
0
def test_get_user_voicemail_after_dissociation(user, voicemail):
    h.user_voicemail.associate(user['id'], voicemail['id'])
    h.user_voicemail.dissociate(user['id'], voicemail['id'])

    response = confd.users(user['id']).voicemail.get()
    response.assert_match(404, e.not_found('UserVoicemail'))

    response = confd.users(user['uuid']).voicemail.get()
    response.assert_match(404, e.not_found('UserVoicemail'))
示例#2
0
def test_fake_fields(voicemail):
    requests = (confd.voicemails.post, confd.voicemails(voicemail["id"]).put)

    for (field, value, error_field) in FAKE:
        for request in requests:
            fields = _generate_fields()
            fields[field] = value
            response = request(fields)
            yield response.assert_match, 400, e.not_found(error_field)
示例#3
0
def test_fake_fields(voicemail):
    requests = (confd.voicemails.post,
                confd.voicemails(voicemail['id']).put)

    for (field, value, error_field) in FAKE:
        for request in requests:
            fields = _generate_fields()
            fields[field] = value
            response = request(fields)
            yield response.assert_match, 400, e.not_found(error_field)
示例#4
0
def test_get_line_from_incall_when_not_associated(line, incall):
    response = confd.extensions(incall['id']).line.get()
    response.assert_match(404, e.not_found('LineExtension'))
示例#5
0
def test_edit_device_with_fake_template(device):
    response = confd.devices(
        device['id']).put(template_id='superdupertemplate')
    response.assert_match(400, e.not_found('DeviceTemplate'))
示例#6
0
def test_get_line_from_fake_extension():
    response = confd.extensions(FAKE_ID).line.get()
    response.assert_match(404, e.not_found('Extension'))
示例#7
0
def test_create_line_with_fake_context():
    response = confd.lines_sip.post(context='fakecontext',
                                      device_slot=1)
    response.assert_match(400, e.not_found('Context'))
def test_get_when_not_associated(user):
    response = confd.users(user['id']).voicemail.get()
    response.assert_match(404, e.not_found('UserVoicemail'))
示例#9
0
 def test_fake_cti_profile(self):
     response = confd.cti_profiles(FAKE_ID).get()
     response.assert_match(404, e.not_found('CtiProfile'))
示例#10
0
def test_create_extension_with_fake_context():
    response = confd.extensions.post(exten='1234', context='fakecontext')
    response.assert_match(400, e.not_found('Context'))
def test_get_when_user_does_not_exist():
    response = confd.users(FAKE_ID).cti.get()
    response.assert_match(404, e.not_found('User'))
示例#12
0
def test_create_line_with_fake_context():
    response = confd.lines.post(context='fakecontext')
    response.assert_match(400, e.not_found('Context'))
示例#13
0
def test_edit_device_with_fake_plugin(device):
    response = confd.devices(device['id']).put(plugin='superduperplugin')
    response.assert_match(400, e.not_found('Plugin'))
示例#14
0
def test_edit_device_with_fake_template(device):
    response = confd.devices(device['id']).put(template_id='superdupertemplate')
    response.assert_match(400, e.not_found('DeviceTemplate'))
示例#15
0
def test_create_device_with_fake_template():
    response = confd.devices.post(template_id='superdupertemplate')
    response.assert_match(400, e.not_found('DeviceTemplate'))
示例#16
0
def test_create_device_with_fake_plugin():
    response = confd.devices.post(plugin='superduperplugin')
    response.assert_match(400, e.not_found('Plugin'))
示例#17
0
 def test_fake_cti_profile(self):
     response = confd.cti_profiles(FAKE_ID).get()
     response.assert_match(404, e.not_found("CtiProfile"))
示例#18
0
def test_create_extension_with_fake_context():
    response = confd.extensions.post(exten='1234',
                                       context='fakecontext')
    response.assert_match(400, e.not_found('Context'))
示例#19
0
def test_get_when_user_does_not_exist():
    response = confd.users(FAKE_ID).cti.get()
    response.assert_match(404, e.not_found('User'))
示例#20
0
def test_get_users_associated_to_voicemail_when_voicemail_does_not_exist():
    response = confd.voicemails(FAKE_ID).users.get()
    response.assert_match(404, e.not_found('Voicemail'))
示例#21
0
def test_edit_extension_with_fake_context(extension):
    response = confd.extensions(extension['id']).put(exten='1234',
                                                       context='fakecontext')
    response.assert_match(400, e.not_found('Context'))
def test_associate_user_with_fake_cti_profile(user):
    url = confd.users(user['id']).cti
    response = url.put(cti_profile_id=FAKE_ID)
    response.assert_match(400, e.not_found('CtiProfile'))
示例#23
0
def test_get_when_not_associated(user):
    response = confd.users(user['id']).voicemail.get()
    response.assert_match(404, e.not_found('UserVoicemail'))
示例#24
0
def test_update_line_with_fake_context(line):
    response = confd.lines(line['id']).put(context='fakecontext')
    response.assert_match(400, e.not_found('Context'))
示例#25
0
def test_create_device_with_fake_plugin():
    response = confd.devices.post(plugin='superduperplugin')
    response.assert_match(400, e.not_found('Plugin'))
示例#26
0
def test_associate_user_with_fake_cti_profile(user):
    url = confd.users(user['id']).cti
    response = url.put(cti_profile_id=FAKE_ID)
    response.assert_match(400, e.not_found('CtiProfile'))
示例#27
0
def test_create_device_with_fake_template():
    response = confd.devices.post(template_id='superdupertemplate')
    response.assert_match(400, e.not_found('DeviceTemplate'))
示例#28
0
def test_edit_extension_with_fake_context(extension):
    response = confd.extensions(extension['id']).put(exten='1234',
                                                     context='fakecontext')
    response.assert_match(400, e.not_found('Context'))
示例#29
0
def test_edit_device_with_fake_plugin(device):
    response = confd.devices(device['id']).put(plugin='superduperplugin')
    response.assert_match(400, e.not_found('Plugin'))
示例#30
0
def test_edit_line_with_fake_context(line):
    response = confd.lines_sip(line['id']).put(context='fakecontext',
                                                 device_slot=1)
    response.assert_match(400, e.not_found('Context'))
示例#31
0
def test_get_users_associated_to_voicemail_when_voicemail_does_not_exist():
    response = confd.voicemails(FAKE_ID).users.get()
    response.assert_match(404, e.not_found('Voicemail'))