mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 06:01:25 -03:30
Mark test as xfail, move to unit testing
This commit is contained in:
parent
5d68f796aa
commit
e99500cf16
@ -82,3 +82,31 @@ def test_invalid_notification_configuration(run_module, admin_user, organization
|
||||
), admin_user)
|
||||
assert result.get('failed', False), result.get('msg', result)
|
||||
assert 'Missing required fields for Notification Configuration' in result['msg']
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@pytest.mark.xfail(reason='Handling API validation changes w.r.t. changed status is an open item')
|
||||
def test_deprecated_to_modern_no_op(run_module, admin_user, organization):
|
||||
nt_config = {
|
||||
'url': 'http://www.example.com/hook',
|
||||
'headers': {
|
||||
'X-Custom-Header': 'value123'
|
||||
}
|
||||
}
|
||||
result = run_module('tower_notification', dict(
|
||||
name='foo-notification-template',
|
||||
organization=organization.name,
|
||||
notification_type='webhook',
|
||||
notification_configuration=nt_config,
|
||||
), admin_user)
|
||||
assert not result.get('failed', False), result.get('msg', result)
|
||||
assert result.pop('changed', None), result
|
||||
|
||||
result = run_module('tower_notification', dict(
|
||||
name='foo-notification-template',
|
||||
organization=organization.name,
|
||||
notification_type='webhook',
|
||||
notification_configuration=nt_config,
|
||||
), admin_user)
|
||||
assert not result.get('failed', False), result.get('msg', result)
|
||||
assert not result.pop('changed', None), result
|
||||
|
||||
@ -114,22 +114,6 @@
|
||||
that:
|
||||
- result is changed
|
||||
|
||||
- name: Recreate with notification_configuration
|
||||
tower_notification:
|
||||
name: "{{ webhook_not }}"
|
||||
organization: Default
|
||||
notification_type: webhook
|
||||
notification_configuration:
|
||||
url: http://www.example.com/hook
|
||||
headers:
|
||||
X-Custom-Header: value123
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
|
||||
- name: Delete webhook notification
|
||||
tower_notification:
|
||||
name: "{{ webhook_not }}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user