Files @ 14eb78a4f466
Branch filter:

Location: majic-ansible-roles/roles/backup/molecule/default/tests/test_parameters_mandatory.py - annotation

branko
MAR-129: Updated php_website role for Ansible 2.5.x and new Molecule:

- Include global linting configuration file in tests.
- Fixed linting issues.
- Fix deprecation warnings from Ansible (for apt module and
state=installed).
- Updated how the hosts are being referenced within tests.
import os

import testinfra.utils.ansible_runner


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


def test_backup_patterns_content(host):
    """
    Tests if content of file containing backup patterns is correct.
    """

    with host.sudo():

        backup_pattern = host.file('/etc/duply/main/patterns/test')

        assert backup_pattern.content == ''


def test_include_content(host):
    """
    Tests if content of assembled include file containing backup patterns is
    correct.
    """

    with host.sudo():

        include = host.file('/etc/duply/main/include')

        assert include.content == ''