| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |