Skip to content

Commit 97973e7

Browse files
committed
Add deprecated tests
1 parent 02662c6 commit 97973e7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/test_deprecated.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
SPDX-FileCopyrightText: 2019 oemof developer group <[email protected]>
3+
SPDX-License-Identifier: MIT
4+
"""
5+
6+
import warnings
7+
8+
import pytest
9+
10+
from windpowerlib.data import load_turbine_data_from_oedb
11+
from windpowerlib.wind_turbine import get_turbine_types
12+
13+
14+
def test_old_import():
15+
msg = "Use >>from windpowerlib import get_turbine_types"
16+
with pytest.raises(ImportError, match=msg):
17+
get_turbine_types()
18+
19+
20+
def test_old_name_load_data_from_oedb():
21+
with warnings.catch_warnings():
22+
warnings.simplefilter("error")
23+
msg = "store_turbine_data_from_oedb"
24+
with pytest.raises(FutureWarning, match=msg):
25+
load_turbine_data_from_oedb()

0 commit comments

Comments
 (0)