Files @ 5f9f8aef3473
Branch filter:

Location: majic-ansible-roles/roles/common/molecule/default/tests/test_deprecated.py

branko
MAR-154: Drop support for Python 2.7 from the common role:

- This primarily concerns removal of pip requirements upgrade checks
for Python 2.7.
- The old Python 3-specific paths are getting deprecated, and the
Python 2 paths will be used instead.
- Set permissions on pipreqcheck directory explicitly (because of
deprecation testing).
import os

import testinfra.utils.ansible_runner

import pytest


testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('parameters-*')


@pytest.mark.parametrize('path', [
    '/etc/pip_check_requirements_upgrades-py3/',
    '/var/lib/pipreqcheck/virtualenv-py3/',
    '/etc/cron.d/check_pip_requirements-py3',
])
def test_deprecated_paths_are_absent(host, path):
    """
    Tests if deprecated paths are absent.
    """

    with host.sudo():
        assert not host.file(path).exists