Passed
Pull Request — dev (#789)
by Uwe
04:00 queued 02:15
created

flow_tests   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 9
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_error_in_gradient_attribute() 0 6 3
1
# -*- coding: utf-8 -
2
3
"""Testing the flows.
4
5
This file is part of project oemof (github.com/oemof/oemof). It's copyrighted
6
by the contributors recorded in the version control history of the file,
7
available from its original location oemof/tests/test_components.py
8
9
SPDX-License-Identifier: MIT
10
"""
11
12
import pytest
13
14
from oemof.solph import Flow
15
16
17
def test_error_in_gradient_attribute():
18
    msg = "Only the key 'ub' is allowed for the '{0}' attribute"
19
    with pytest.raises(AttributeError, match=msg.format("negative_gradient")):
20
        Flow(negative_gradient={"costs": 5})
21
    with pytest.raises(AttributeError, match=msg.format("positive_gradient")):
22
        Flow(positive_gradient={"something": 5})
23