def test_attrs(aws_resource, aws_host, attr, should): _, attrs, _ = aws_host(aws_resource, 'module_name') assert attr in attrs assert attrs[attr] == should
def test_groups(aws_resource, aws_host, group): _, _, groups = aws_host(aws_resource, 'module_name') assert group in groups
def test_name(aws_resource, aws_host): name, _, _ = aws_host(aws_resource, '') assert name == 'mi-control-01'
def test_groups(aws_resource, aws_host, group): _, _, groups = aws_host(aws_resource) assert group in groups
def test_private_ip_default(aws_resource, aws_host): private_resource = deepcopy(aws_resource) private_resource["primary"]["attributes"]["public_ip"] = "" _, attrs, _ = aws_host(private_resource, 'module_name') assert attrs['ansible_ssh_host'] == '10.0.152.191'
def test_name(aws_resource, aws_host): name, _, _ = aws_host(aws_resource, "") assert name == "mi-control-01"
def test_private_ip_default(aws_resource, aws_host): private_resource = deepcopy(aws_resource) private_resource["primary"]["attributes"]["public_ip"] = "" _, attrs, _ = aws_host(private_resource, "module_name") assert attrs["ansible_ssh_host"] == "10.0.152.191"