Mark test as xfail, move to unit testing

This commit is contained in:
AlanCoding 2020-04-02 14:48:33 -04:00
parent 5d68f796aa
commit e99500cf16
No known key found for this signature in database
GPG Key ID: FD2C3C012A72926B
2 changed files with 28 additions and 16 deletions

View File

@ -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

View File

@ -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 }}"