

@unpack
@data((1, 47, 47, 0), (1, 46, 47, 1), (2, 45, 47, 2), (47, 1, 47, 46), (47, 5, 47, 46))
def test_get_free_u_for_one_asset(self, position, height, max_u_height, expected):
    rack = RackFactory(max_u_height=max_u_height)
    asset_kwargs = {
        'rack': rack,
        'model__height_of_device': height,
        'position': position,
        'slot_no': None,
        'orientation': Orientation.front.id,
    }
    DataCenterAssetFactory(**asset_kwargs)
    self.assertEqual(rack.get_free_u(), expected)

dataset/ETHPy150Open allegro/ralph/src/ralph/data_center/tests/test_models.py RackTest.test_get_free_u_for_one_asset/original