跳转到主要内容

pytest插件,用于帮助测试idem项目

项目描述

pytest插件,用于帮助测试idem项目

安装

使用pip安装

pip install pytest-idem

开发安装

克隆pytest-idem仓库并使用pip安装

git clone https://gitlab.com/vmware/idem/pytest-idem.git
pip install -e pytest-idem

ACCT

某些项目,特别是需要从idem的ctx生成器中获取凭证。存在一个ctx固定装置,但除非你覆盖了acct_file和acct_profile固定装置,否则它将不起作用

@pytest.fixture
def acct_subs() -> List[str]:
    return ["azurerm", "vultr"]


@pytest.fixture
def acct_profile() -> str:
    return "test_development_idem_cloud"

一旦覆盖了这些固定装置,ctx固定装置将可用于你的测试

test_cloud_instance_present(hub, ctx):
    hub.state.cloud.present(ctx, "instance_name")

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分布

pytest-idem-4.0.1.tar.gz (11.9 kB 查看哈希值)

上传于 源代码

构建版本

pytest_idem-4.0.1-py3-none-any.whl (11.9 kB 查看哈希值)

上传于 Python 3

由以下支持