-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_integration.py
38 lines (34 loc) · 1.36 KB
/
test_integration.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import pytest
from plugins.my_plugin.assertions import StateAssertions
@pytest.mark.universal
@pytest.mark.parametrize("target_vendor", ["Tyan", "Fujitsu", "Dell"])
@pytest.mark.parametrize("drives_type", ["HDD", "SSD"])
def test_reservation_create(
product, target_vendor, create_reservation_config, create_reservation, drives_type
):
reservation_config = create_reservation_config(target_vendor, drives_type)
reservation_data = create_reservation(reservation_config)
assert reservation_data["reservation_id"]
assert product.get_resource_status(reservation_config["server"]["model"])[
"is_reserved"
]
@pytest.mark.universal
@pytest.mark.parametrize("target_vendor", ["Tyan", "Fujitsu", "Dell"])
@pytest.mark.parametrize("drives_type", ["HDD", "SSD"])
def test_reservation_create_compable_asserts(
product,
target_vendor,
create_reservation_config,
create_reservation,
drives_type,
assert_resource_reserved,
):
reservation_config = create_reservation_config(target_vendor, drives_type)
reservation_data = create_reservation(reservation_config)
assert reservation_data["reservation_id"]
StateAssertions.assert_resource_reserved(
product.get_resource_status(reservation_config["server"]["model"])
)
assert_resource_reserved(
product.get_resource_status(reservation_config["server"]["model"])
)