コード例 #1
0
def test_multiple_reference_products():
    ds = {'exchanges': [{
        'type': 'reference product',
    }, {
        'type': 'reference product',
    }]}
    with pytest.raises(InvalidMultioutputDataset):
        check_single_output_activity(ds)
コード例 #2
0
def test_multiple_reference_products():
    ds = {'exchanges': [{
        'type': 'reference product',
    }, {
        'type': 'reference product',
    }]}
    with pytest.raises(InvalidMultioutputDataset):
        check_single_output_activity(ds)
コード例 #3
0
def test_wrong_byproduct():
    ds = {'exchanges': [{
        'type': 'reference product',
    }, {
        'type': 'byproduct',
        'byproduct classification': 'allocatable product'
    }]}
    with pytest.raises(InvalidMultioutputDataset):
        check_single_output_activity(ds)
コード例 #4
0
def test_wrong_byproduct():
    ds = {'exchanges': [{
        'type': 'reference product',
    }, {
        'type': 'byproduct',
        'byproduct classification': 'allocatable product'
    }]}
    with pytest.raises(InvalidMultioutputDataset):
        check_single_output_activity(ds)
コード例 #5
0
def test_correct_byproduct():
    ds = {'exchanges': [{
        'type': 'reference product',
    }, {
        'type': 'byproduct',
        'byproduct classification': 'waste'
    }]}
    assert check_single_output_activity(ds)
コード例 #6
0
def test_correct_byproduct():
    ds = {'exchanges': [{
        'type': 'reference product',
    }, {
        'type': 'byproduct',
        'byproduct classification': 'waste'
    }]}
    assert check_single_output_activity(ds)
コード例 #7
0
def test_no_reference_product():
    ds = {'exchanges': [{'type': 'to environment'}]}
    with pytest.raises(InvalidMultioutputDataset):
        check_single_output_activity(ds)
コード例 #8
0
def test_check_single_output():
    ds = {'exchanges': [{'type': 'reference product'}]}
    assert check_single_output_activity(ds)
    assert check_single_output_activity(ds) is ds
コード例 #9
0
def test_no_reference_product():
    ds = {'exchanges': [{
        'type': 'to environment'
    }]}
    with pytest.raises(InvalidMultioutputDataset):
        check_single_output_activity(ds)
コード例 #10
0
def test_check_single_output():
    ds = {'exchanges': [{
        'type': 'reference product'
    }]}
    assert check_single_output_activity(ds)
    assert check_single_output_activity(ds) is ds