Example #1
0
def test_create_invalid_total_value():
    with pytest.raises(ValueError):
        inventory.Resource('name', 'manu', -10, 0)
Example #2
0
def test_create_invalid_allocated_value(total, allocated):
    with pytest.raises(ValueError):
        inventory.Resource('name', 'manu', total, allocated)
Example #3
0
def test_create_invalid_total_type():
    with pytest.raises(TypeError):
        inventory.Resource('Parrot', 'Pirates A-Hoy', 10.5, 5)
Example #4
0
def test_create_invalid_allocated_type():
    with pytest.raises(TypeError):
        inventory.Resource('name', 'manu', 10, 2.5)
Example #5
0
def resource(resource_values):
    return inventory.Resource(**resource_values)
Example #6
0
def test_create_invalid_total_type():
    with pytest.raises(TypeError):
        inventory.Resource('name', 'manu', 10.5, 100)
Example #7
0
def test_create_invalid_total_value():
	with pytest.raises(ValueError):
		resource = inventory.Resource("name", "manu", -10, 0)
Example #8
0
def test_create_invalid_allocated_type():
	with pytest.raises(TypeError):
		resource = inventory.Resource("name", "manu", 10, 2.5)
Example #9
0
def test_create_invalid_total_type():
	with pytest.raises(TypeError):
		resource = inventory.Resource("Parrot", "Pirate A-Hoy", 10.5, 5)