Skip to content

Commit

Permalink
fix typo in test_host (#15013)
Browse files Browse the repository at this point in the history
  • Loading branch information
pondrejk authored May 9, 2024
1 parent 67110bf commit db62d33
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/foreman/cli/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,13 @@ def test_positive_crud_interface_by_id(target_sat, default_location, default_org

mac = gen_mac(multicast=False)
host = target_sat.cli_factory.make_fake_host({'domain-id': domain.id})
number_of_interfaces = len(target_sat.cliHostInterface.list({'host-id': host['id']}))
number_of_interfaces = len(target_sat.cli.HostInterface.list({'host-id': host['id']}))

target_sat.cliHostInterface.create(
target_sat.cli.HostInterface.create(
{'host-id': host['id'], 'domain-id': domain.id, 'mac': mac, 'type': 'interface'}
)
host = target_sat.cli.Host.info({'id': host['id']})
host_interface = target_sat.cliHostInterface.info(
host_interface = target_sat.cli.HostInterface.info(
{
'host-id': host['id'],
'id': [ni for ni in host['network-interfaces'] if ni['mac-address'] == mac][0]['id'],
Expand All @@ -375,22 +375,22 @@ def test_positive_crud_interface_by_id(target_sat, default_location, default_org
assert host_interface['domain'] == domain.name
assert host_interface['mac-address'] == mac
assert (
len(target_sat.cliHostInterface.list({'host-id': host['id']})) == number_of_interfaces + 1
len(target_sat.cli.HostInterface.list({'host-id': host['id']})) == number_of_interfaces + 1
)

new_domain = target_sat.api.Domain(
location=[default_location], organization=[default_org]
).create()
new_mac = gen_mac(multicast=False)
target_sat.cliHostInterface.update(
target_sat.cli.HostInterface.update(
{
'host-id': host['id'],
'id': host_interface['id'],
'domain-id': new_domain.id,
'mac': new_mac,
}
)
host_interface = target_sat.cliHostInterface.info(
host_interface = target_sat.cli.HostInterface.info(
{
'host-id': host['id'],
'id': [ni for ni in host['network-interfaces'] if ni['mac-address'] == mac][0]['id'],
Expand All @@ -399,10 +399,10 @@ def test_positive_crud_interface_by_id(target_sat, default_location, default_org
assert host_interface['domain'] == new_domain.name
assert host_interface['mac-address'] == new_mac

target_sat.cliHostInterface.delete({'host-id': host['id'], 'id': host_interface['id']})
assert len(target_sat.cliHostInterface.list({'host-id': host['id']})) == number_of_interfaces
target_sat.cli.HostInterface.delete({'host-id': host['id'], 'id': host_interface['id']})
assert len(target_sat.cli.HostInterface.list({'host-id': host['id']})) == number_of_interfaces
with pytest.raises(CLIReturnCodeError):
target_sat.cliHostInterface.info({'host-id': host['id'], 'id': host_interface['id']})
target_sat.cli.HostInterface.info({'host-id': host['id'], 'id': host_interface['id']})


@pytest.mark.cli_host_create
Expand Down

0 comments on commit db62d33

Please sign in to comment.