Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into fix/#266-provide_powerfactor_mode
- Loading branch information
Showing
15 changed files
with
876 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
from sqlalchemy.orm import sessionmaker | ||
import oedialect | ||
|
||
|
||
# define logger | ||
logger = setup_logger() | ||
|
||
|
Empty file.
Empty file.
Empty file.
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,23 @@ | ||
import pytest | ||
from ding0.core.network import GridDing0, \ | ||
GeneratorDing0, GeneratorFluctuatingDing0 | ||
|
||
|
||
class TestMVStationDing0(object): | ||
|
||
@pytest.fixture | ||
def empty_gridding0(self): | ||
""" | ||
Returns an empty GridDing0 object | ||
""" | ||
return GridDing0() | ||
|
||
def test_mv_grid_districts(self): | ||
pass | ||
|
||
def test_run_ding0(self): | ||
pass | ||
|
||
|
||
if __name__ == "__main__": | ||
pass |
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,43 @@ | ||
import pytest | ||
|
||
from egoio.tools import db | ||
from sqlalchemy.orm import sessionmaker | ||
import oedialect | ||
|
||
from ding0.core import NetworkDing0 | ||
|
||
|
||
class TestNetworkDing0(object): | ||
|
||
@pytest.fixture | ||
def emptyNetworkDing0(self): | ||
""" | ||
Returns an empty NetworkDing0 object for testing | ||
""" | ||
return NetworkDing0() | ||
|
||
@pytest.fixture | ||
def oedb_session(self): | ||
""" | ||
Returns an ego.io oedb session and closes it on finishing the test | ||
""" | ||
engine = db.connection(section='oedb') | ||
session = sessionmaker(bind=engine)() | ||
yield session | ||
print("closing session") | ||
session.close() | ||
|
||
def test_empty_mv_grid_districts(self, emptyNetworkDing0): | ||
mv_grid_districts = list(emptyNetworkDing0.mv_grid_districts()) | ||
empty_list = [] | ||
assert mv_grid_districts == empty_list | ||
|
||
def test_import_mv_grid_districts(self, oedb_session): | ||
with pytest.raises(TypeError): | ||
NetworkDing0.import_mv_grid_districts( | ||
oedb_session, | ||
mv_grid_districts_no=['5'] | ||
) | ||
|
||
# def test_run_ding0(self): | ||
# pass |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.