Skip to content

Commit

Permalink
squash: extend test
Browse files Browse the repository at this point in the history
  • Loading branch information
skycastlelily committed May 15, 2024
1 parent a3894a1 commit 6fbfb08
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions tests/unit/provision/mrack/test_hw.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
_parse_cpu,
_parse_disk,
_parse_hostname,
_parse_location,
_parse_memory,
_parse_virtualization,
_parse_zcrypt,
Expand Down Expand Up @@ -231,6 +232,12 @@ def test_maximal_constraint(root_logger: Logger) -> None:
'_value': '%.foo.redhat.com'
}
},
{
'labcontroller': {
'_op': '!=',
'_value': 'lab-01.rhts.eng.pek2.redhat.com'
}
},
{'or': []},
{
'and': [
Expand Down Expand Up @@ -278,12 +285,6 @@ def test_maximal_constraint(root_logger: Logger) -> None:
]
},

{
'labcontroller': {
'_op': '!=',
'_value': 'lab-01.rhts.eng.pek2.redhat.com'
}
},
]
}

Expand Down Expand Up @@ -678,3 +679,26 @@ def test_zcrypt_mode(root_logger: Logger) -> None:
}
}
}


def test_location_lab_controller(root_logger: Logger) -> None:

result = _CONSTRAINT_TRANSFORMERS['location.lab_controller'](
_parse_location({"lab-controller": "lab-01.rhts.eng.pek2.redhat.com"}), root_logger)

assert result.to_mrack() == {
'labcontroller': {
'_op': '==',
'_value': 'lab-01.rhts.eng.pek2.redhat.com'
}
}

result = _CONSTRAINT_TRANSFORMERS['location.lab_controller'](
_parse_location({"lab-controller": "!= lab-01.rhts.eng.pek2.redhat.com"}), root_logger)

assert result.to_mrack() == {
'labcontroller': {
'_op': '!=',
'_value': 'lab-01.rhts.eng.pek2.redhat.com'
}
}

0 comments on commit 6fbfb08

Please sign in to comment.