ansible/test/sanity/code-smell/azure-requirements.py
Matt Clay 18867847f4
Split up "code smell" sanity tests. (#60174)
* Relocate ansible-only sanity tests.

* Get "code smell" sanity tests from multiple dirs.

- `test/lib/ansible_test/_data/sanity/code-smell/` - General purpose tests used for both Ansible and Ansible Collections.
- `test/sanity/code-smell/` - Tests specific to Ansible, will not be used for Ansible Collections.
2019-08-06 17:17:57 -07:00

30 lines
740 B
Python
Executable file

#!/usr/bin/env python
"""Make sure the Azure requirements files match."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import filecmp
import os
def main():
src = 'packaging/requirements/requirements-azure.txt'
dst = 'test/lib/ansible_test/_data/requirements/integration.cloud.azure.txt'
missing = [p for p in [src, dst] if not os.path.isfile(p)]
if missing:
for path in missing:
print('%s: missing required file' % path)
return
if not filecmp.cmp(src, dst):
print('%s: must be identical to `%s`' % (dst, src))
if os.path.islink(dst):
print('%s: must not be a symbolic link' % dst)
if __name__ == '__main__':
main()