Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 350 plugins can import most commonly used flex measures classes…
… from a central place (#354) * Let common classes be imported from a central place in flexmeasures Signed-off-by: F.N. Claessen <felix@seita.nl> * Add test Signed-off-by: F.N. Claessen <felix@seita.nl> * Changelog entry Signed-off-by: F.N. Claessen <felix@seita.nl> * Consider Annotation and GenericAssetType as common classes, too Signed-off-by: F.N. Claessen <felix@seita.nl>
- Loading branch information
Showing
5 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"class_name", | ||
[ | ||
"Account", | ||
"AccountRole", | ||
"Asset", | ||
"Sensor", | ||
"Source", | ||
"User", | ||
], | ||
) | ||
def test_class_imports(class_name: str): | ||
"""Make sure that plugins can import these classes as `from flexmeasures import <class_name>`.""" | ||
import flexmeasures as fm | ||
|
||
assert hasattr(fm, class_name) |