예제 #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'))
예제 #8
0
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'))
예제 #11
0
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'))
예제 #22
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'))
예제 #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'))