def test_validation_duplicate_hosts(self): # data contains duplicate hosts pool = ZerobootPool( name="test", data={"zerobootHosts": ["host1", "host2", "host1"]}) pool._validate_host = MagicMock() with pytest.raises( ValueError, message="invalid data should contain duplicate host names"): pool.validate()
def test_valid_hosts(self): pool = ZerobootPool(name="test", data={"zerobootHosts": ["host1", "host2"]}) pool._validate_host = MagicMock() pool.validate()