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'))
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)
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)
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'))
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'))
def test_get_line_from_fake_extension(): response = confd.extensions(FAKE_ID).line.get() response.assert_match(404, e.not_found('Extension'))
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'))
def test_fake_cti_profile(self): response = confd.cti_profiles(FAKE_ID).get() response.assert_match(404, e.not_found('CtiProfile'))
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'))
def test_create_line_with_fake_context(): response = confd.lines.post(context='fakecontext') response.assert_match(400, e.not_found('Context'))
def test_edit_device_with_fake_plugin(device): response = confd.devices(device['id']).put(plugin='superduperplugin') response.assert_match(400, e.not_found('Plugin'))
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'))
def test_create_device_with_fake_template(): response = confd.devices.post(template_id='superdupertemplate') response.assert_match(400, e.not_found('DeviceTemplate'))
def test_create_device_with_fake_plugin(): response = confd.devices.post(plugin='superduperplugin') response.assert_match(400, e.not_found('Plugin'))
def test_fake_cti_profile(self): response = confd.cti_profiles(FAKE_ID).get() response.assert_match(404, e.not_found("CtiProfile"))
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'))
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'))
def test_update_line_with_fake_context(line): response = confd.lines(line['id']).put(context='fakecontext') response.assert_match(400, e.not_found('Context'))
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'))