コード例 #1
0
def test_create_invalid_total_value():
    with pytest.raises(ValueError):
        inventory.Resource('name', 'manu', -10, 0)
コード例 #2
0
def test_create_invalid_allocated_value(total, allocated):
    with pytest.raises(ValueError):
        inventory.Resource('name', 'manu', total, allocated)
コード例 #3
0
def test_create_invalid_total_type():
    with pytest.raises(TypeError):
        inventory.Resource('Parrot', 'Pirates A-Hoy', 10.5, 5)
コード例 #4
0
def test_create_invalid_allocated_type():
    with pytest.raises(TypeError):
        inventory.Resource('name', 'manu', 10, 2.5)
コード例 #5
0
def resource(resource_values):
    return inventory.Resource(**resource_values)
コード例 #6
0
def test_create_invalid_total_type():
    with pytest.raises(TypeError):
        inventory.Resource('name', 'manu', 10.5, 100)
コード例 #7
0
ファイル: test_resources.py プロジェクト: binexisHATT/Python
def test_create_invalid_total_value():
	with pytest.raises(ValueError):
		resource = inventory.Resource("name", "manu", -10, 0)
コード例 #8
0
ファイル: test_resources.py プロジェクト: binexisHATT/Python
def test_create_invalid_allocated_type():
	with pytest.raises(TypeError):
		resource = inventory.Resource("name", "manu", 10, 2.5)
コード例 #9
0
ファイル: test_resources.py プロジェクト: binexisHATT/Python
def test_create_invalid_total_type():
	with pytest.raises(TypeError):
		resource = inventory.Resource("Parrot", "Pirate A-Hoy", 10.5, 5)