def test_create_invalid_allocated_value(total, allocated): with pytest.raises(ValueError): inventory.Resource('name', 'manu', total, allocated)
def test_create_invalid_total_value(): with pytest.raises(ValueError): inventory.Resource('name', 'manu', -10, 0)
def test_create_invalid_total_type(): with pytest.raises(TypeError): inventory.Resource('Parrot', 'Pirates A-Hoy', 10.5, 5)
def test_create_invalid_allocated_type(): with pytest.raises(TypeError): inventory.Resource('name', 'manu', 10, 2.5)
def resource(resource_values): return inventory.Resource(**resource_values)