def test_create_invalid_cores_value(cores):
    with pytest.raises(ValueError):
        inventory.CPU('name', 'manu', 100, 50, cores, 'sock', 98)
def test_create_invalid_power_value(power_watts):
    with pytest.raises(ValueError):
        inventory.CPU('name', 'manu', 100, 50, 1, 'sock', power_watts)
def test_create_invalid_cores_type():
    with pytest.raises(TypeError):
        inventory.CPU('name', 'manu', 100, 50, 0.5, 'sock', 98)
def test_create_invalid_power_type():
    with pytest.raises(TypeError):
        inventory.CPU('name', 'manu', 100, 50, 1, 'sock', 'pow')
def cpu(CPU_values):
    return inventory.CPU(**CPU_values)
Ejemplo n.º 6
0
def test_create_invalid_power(watts, exception, cpu_values):
    cpu_values['power_watts'] = watts
    with pytest.raises(exception):
        inventory.CPU(**cpu_values)
Ejemplo n.º 7
0
def test_create_invalid_cores(cores, exception, cpu_values):
    cpu_values['cores'] = cores
    with pytest.raises(exception):
        inventory.CPU(**cpu_values)
Ejemplo n.º 8
0
def cpu(cpu_values):
    return inventory.CPU(**cpu_values)
Ejemplo n.º 9
0
def cpu(cpu_values):
    inventory.CPU(**cpu_values)