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)
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)
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)
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)
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)
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)
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)
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)
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)