Exemplo n.º 1
0
    def pytest_ignore_collect(self, path, config):
        # do not ignore directories
        if path.check(dir=True):
            return False

        # ignore everything else that is not a test playbook
        return not is_test_playbook_file(path)
def test_is_test_playbook_file_with_valid_extension(tmpdir,
                                                    valid_playbook_extension,
                                                    valid_test_playbook):
    path = tmpdir.join('test_playbook.' + valid_playbook_extension)
    path.write(valid_test_playbook)

    assert ansible_support.is_test_playbook_file(path)
Exemplo n.º 3
0
    def consider_and_create(cls, path, parent):
        if ansible_support.is_test_playbook_file(path):
            ctx = GoodplayContext(playbook_path=path, config=parent.config)

            if ctx.inventory_path:
                return GoodplayPlaybookFile(ctx, path, parent)
Exemplo n.º 4
0
    def consider_and_create(cls, path, parent):
        if ansible_support.is_test_playbook_file(path):
            ctx = GoodplayContext(playbook_path=path)

            if ctx.inventory_path:
                return GoodplayPlaybookFile(ctx, path, parent)
Exemplo n.º 5
0
def test_is_test_playbook_file_with_invalid_extension(
        tmpdir, invalid_playbook_extension, valid_test_playbook):
    path = tmpdir.join('test_playbook.' + invalid_playbook_extension)
    path.write(valid_test_playbook)

    assert not ansible_support.is_test_playbook_file(path)
Exemplo n.º 6
0
def test_is_test_playbook_file_with_invalid_prefix(
        tmpdir, valid_test_playbook):
    path = tmpdir.join('playbook.yml')
    path.write(valid_test_playbook)

    assert not ansible_support.is_test_playbook_file(path)
Exemplo n.º 7
0
def test_is_test_playbook_file_with_invalid_content(
        tmpdir, invalid_test_playbook_content):
    path = tmpdir.join('test_playbook.yml')
    path.write(invalid_test_playbook_content)

    assert not ansible_support.is_test_playbook_file(path)
Exemplo n.º 8
0
def test_is_test_playbook_file_with_valid_content(tmpdir, valid_test_playbook_content):
    path = tmpdir.join("test_playbook.yml")
    path.write(valid_test_playbook_content)

    assert ansible_support.is_test_playbook_file(path)
Exemplo n.º 9
0
def test_is_test_playbook_file_with_valid_extension(tmpdir, valid_playbook_extension, valid_test_playbook):
    path = tmpdir.join("test_playbook." + valid_playbook_extension)
    path.write(valid_test_playbook)

    assert ansible_support.is_test_playbook_file(path)
Exemplo n.º 10
0
def test_is_test_playbook_file_with_invalid_prefix(tmpdir,
                                                   valid_test_playbook):
    path = tmpdir.join('playbook.yml')
    path.write(valid_test_playbook)

    assert not ansible_support.is_test_playbook_file(path)
Exemplo n.º 11
0
def test_is_test_playbook_file_with_invalid_content(
        tmpdir, invalid_test_playbook_content):
    path = tmpdir.join('test_playbook.yml')
    path.write(invalid_test_playbook_content)

    assert not ansible_support.is_test_playbook_file(path)