mirror of
https://github.com/thegeeklab/prometheus-pve-sd.git
synced 2024-11-25 02:40:39 +00:00
29 lines
598 B
Python
29 lines
598 B
Python
"""Test Autostop class."""
|
|
|
|
import pytest
|
|
from proxmoxer import ProxmoxAPI
|
|
|
|
from prometheuspvesd import discovery
|
|
|
|
pytest_plugins = [
|
|
"prometheuspvesd.test.fixtures.fixtures",
|
|
]
|
|
|
|
|
|
@pytest.fixture
|
|
def discovery_fixture(mocker):
|
|
mocker.patch.object(
|
|
discovery.Discovery, "_auth", return_value=mocker.create_autospec(ProxmoxAPI)
|
|
)
|
|
|
|
return discovery.Discovery()
|
|
|
|
|
|
def test_exclude(discovery_fixture, qemus):
|
|
discovery_fixture.config.config["exclude_vmid"] = ["100", "101"]
|
|
|
|
expected = []
|
|
filtered = discovery_fixture._exclude(qemus)
|
|
|
|
assert filtered == expected
|