1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/sanity/code-smell/azure-requirements.py
Matt Clay dc71c2197f
More code-smell sanity test updates. (#36830)
* Add test for missing Azure requirements.
* Improve readability.
* Enhance no-unicode-literals code-smell test.
2018-02-28 00:50:00 -08:00

28 lines
636 B
Python
Executable file

#!/usr/bin/env python
"""Make sure the Azure requirements files match."""
import filecmp
import os
def main():
src = 'packaging/requirements/requirements-azure.txt'
dst = 'test/runner/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()