def test_edit_voicemail_with_same_number_and_context(first_voicemail, second_voicemail): response = confd.voicemails(first_voicemail['id']).put(number=second_voicemail['number'], context=second_voicemail['context']) response.assert_match(400, e.resource_exists('Voicemail'))
def test_create_2_call_permissions_with_same_name(call_permission): response = confd.callpermissions.post(name=call_permission['name']) response.assert_match(400, e.resource_exists('CallPermission'))
def test_edit_voicemail_with_same_number_and_context(first_voicemail, second_voicemail): response = confd.voicemails(first_voicemail["id"]).put( number=second_voicemail["number"], context=second_voicemail["context"] ) response.assert_match(400, e.resource_exists("Voicemail"))
def test_create_voicemail_with_same_number_and_context(voicemail): response = confd.voicemails.post(name='testvoicemail', number=voicemail['number'], context=voicemail['context']) response.assert_match(400, e.resource_exists('Voicemail'))
def test_edit_device_with_same_mac(first_device, second_device): response = confd.devices(first_device['id']).put(mac=second_device['mac']) response.assert_match(400, e.resource_exists('Device'))
def test_create_voicemail_with_same_number_and_context(voicemail): response = confd.voicemails.post(name="testvoicemail", number=voicemail["number"], context=voicemail["context"]) response.assert_match(400, e.resource_exists("Voicemail"))
def test_when_updating_custom_with_interface_that_already_exists_then_error_raised(custom, duplicate): response = confd.endpoints.custom(custom['id']).put(interface=duplicate['interface']) response.assert_match(400, e.resource_exists('CustomEndpoint'))
def test_put_email_already_exists_then_error_raised(_, user): response = confd.users(user['uuid']).put(email='*****@*****.**') response.assert_match(400, e.resource_exists('User'))
def test_create_2_devices_with_same_mac(device): response = confd.devices.post(mac=device['mac']) response.assert_match(400, e.resource_exists('Device'))
def test_post_email_already_exists_then_error_raised(user): response = confd.users.post(firstname='bob', email='*****@*****.**') response.assert_match(400, e.resource_exists('User'))
def test_create_sip_with_username_already_taken(sip): response = confd.endpoints.sip.post(username="******") response.assert_match(400, e.resource_exists('SIPEndpoint'))
def test_create_2_extensions_with_same_exten(extension): response = confd.extensions.post(context=extension['context'], exten=extension['exten']) response.assert_match(400, e.resource_exists('Extension'))
def test_edit_call_permission_with_same_name(first_call_permission, second_call_permission): response = confd.callpermissions(first_call_permission['id']).put(name=second_call_permission['name']) response.assert_match(400, e.resource_exists('CallPermission'))
def test_given_interface_already_exists_then_error_raised(): response = confd.endpoints.custom.post(interface='custom/duplicate') response.assert_ok() response = confd.endpoints.custom.post(interface='custom/duplicate') response.assert_match(400, e.resource_exists('CustomEndpoint'))