Exemple #1
0
def test_dissociate_when_line_associated_to_device(user, line, extension,
                                                   device):
    with a.line_extension(line, extension), a.user_line(user,
                                                        line), a.line_device(
                                                            line, device):
        response = confd.lines(line['id']).extension.delete()
        response.assert_match(400, e.resource_associated('Line', 'Device'))
Exemple #2
0
def test_dissociate_sip_endpoint_associated_to_device(user, line, sip,
                                                      extension, device):
    with a.line_endpoint_sip(line,
                             sip), a.user_line(user, line), a.line_extension(
                                 line, extension), a.line_device(line, device):
        response = confd.lines(line['id']).endpoints.sip(sip['id']).delete()
        response.assert_match(400, e.resource_associated())
Exemple #3
0
def test_associate_when_user_already_associated_to_same_call_permission(
        user, call_permission):
    with a.user_call_permission(user, call_permission):
        response = confd.users(user['id']).callpermissions(
            call_permission['id']).put()
        response.assert_match(400,
                              e.resource_associated('User', 'CallPermission'))
Exemple #4
0
def test_associate_two_internal_extensions_to_same_line(
        first_extension, second_extension, line):
    associate = confd.lines(line['id']).extensions

    response = associate.post(extension_id=first_extension['id'])
    response.assert_created('lines', 'extensions')

    response = associate.post(extension_id=second_extension['id'])
    response.assert_match(400, e.resource_associated('Line', 'Extension'))
Exemple #5
0
def test_associate_with_another_endpoint_when_already_associated(
        line, custom1, custom2):
    with a.line_endpoint_custom(line, custom1):
        response = confd.lines(line['id']).endpoints.custom(
            custom2['id']).put()
        response.assert_match(400, e.resource_associated('Line', 'Endpoint'))
Exemple #6
0
def test_associate_with_another_endpoint_when_already_associated(
        line, sccp1, sccp2):
    with a.line_endpoint_sccp(line, sccp1):
        response = confd.lines(line['id']).endpoints.sccp(sccp2['id']).put()
        response.assert_match(400, e.resource_associated('Line', 'Endpoint'))
Exemple #7
0
def test_delete_extension_associated_to_line(line, extension):
    with a.line_extension(line, extension):
        response = confd.extensions(extension['id']).delete()
        response.assert_match(400, e.resource_associated('Extension', 'Line'))
Exemple #8
0
def test_delete_user_when_user_and_line_associated(user, line):
    with a.user_line(user, line):
        response = confd.users(user['id']).delete()
        response.assert_match(400, e.resource_associated('User', 'Line'))
def test_delete_voicemail_when_still_associated(user, voicemail):
    with user_and_voicemail_associated(user, voicemail):
        response = confd.voicemails(voicemail['id']).delete()
        response.assert_match(400, e.resource_associated('Voicemail', 'User'))
Exemple #10
0
def test_delete_user_when_user_and_line_associated(user, line):
    with user_and_line_associated(user, line):
        response = confd.users(user['id']).delete()
        response.assert_match(400, e.resource_associated('User', 'Line'))
Exemple #11
0
def test_associate_when_user_already_associated_to_another_line(user, first_line, second_line):
    with user_and_line_associated(user, first_line):
        response = confd.users(user['id']).lines.post(line_id=first_line['id'])
        response.assert_match(400, e.resource_associated('User', 'Line'))
Exemple #12
0
def test_associate_when_already_associated(user, voicemail):
    with a.user_voicemail(user, voicemail):
        response = confd.users(
            user['id']).voicemail.post(voicemail_id=voicemail['id'])
        response.assert_match(400, e.resource_associated('User', 'Voicemail'))
Exemple #13
0
def test_delete_voicemail_when_still_associated(user, voicemail):
    with a.user_voicemail(user, voicemail):
        response = confd.voicemails(voicemail['id']).delete()
        response.assert_match(400, e.resource_associated('Voicemail', 'User'))
Exemple #14
0
def test_associate_when_endpoint_already_associated(line, sip):
    with a.line_endpoint_sip(line, sip):
        response = confd.lines(line['id']).endpoints.sip(sip['id']).put()
        response.assert_match(400, e.resource_associated('Line', 'Endpoint'))
def test_associate_when_already_associated(user, voicemail):
    with user_and_voicemail_associated(user, voicemail):
        response = confd.users(user['id']).voicemail.post(voicemail_id=voicemail['id'])
        response.assert_match(400, e.resource_associated('User', 'Voicemail'))
Exemple #16
0
def test_dissociate_when_associated_to_user(line, custom, user):
    with a.line_endpoint_custom(line, custom), a.user_line(user, line):
        response = confd.lines(line['id']).endpoints.custom(
            custom['id']).delete()
        response.assert_match(400, e.resource_associated('Line', 'User'))
Exemple #17
0
def test_dissociate_when_associated_to_extension(line, custom, extension):
    with a.line_endpoint_custom(line,
                                custom), a.line_extension(line, extension):
        response = confd.lines(line['id']).endpoints.custom(
            custom['id']).delete()
        response.assert_match(400, e.resource_associated('Line', 'Extension'))
Exemple #18
0
def test_associate_when_user_already_associated_to_another_line(user, first_line, second_line):
    with a.user_line(user, first_line):
        response = confd.users(user['id']).lines.post(line_id=first_line['id'])
        response.assert_match(400, e.resource_associated('User', 'Line'))