Пример #1
0
def test_delete_endpoint_dissociates_line(line, custom):
    with a.line_endpoint_custom(line, custom, check=False):
        response = confd.endpoints.custom(custom['id']).delete()
        response.assert_deleted()

        response = confd.lines(line['id']).endpoints.custom.get()
        response.assert_status(404)
Пример #2
0
def test_get_line_associated_to_a_custom_endpoint(line, custom):
    response = confd.endpoints.custom(custom['id']).lines.get()
    response.assert_status(404)

    with a.line_endpoint_custom(line, custom):
        response = confd.endpoints.custom(custom['id']).lines.get()
        assert_that(
            response.item,
            has_entries({
                'line_id': line['id'],
                'endpoint_id': custom['id'],
                'endpoint': 'custom'
            }))
Пример #3
0
def test_summary_view_on_custom_endpoint(user, line, custom, extension):
    expected = has_entries(id=user['id'],
                           uuid=user['uuid'],
                           firstname=user['firstname'],
                           lastname=user['lastname'],
                           provisioning_code=none(),
                           extension=extension['exten'],
                           context=extension['context'],
                           entity=config.ENTITY_NAME,
                           enabled=True,
                           protocol='custom')

    with a.line_endpoint_custom(line, custom), a.line_extension(line, extension), \
            a.user_line(user, line):

        response = confd.users.get(view='summary', id=user['id'])
        assert_that(response.items, contains(expected))
Пример #4
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'))
Пример #5
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'))
Пример #6
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'))