Skip to content

Commit c91c135

Browse files
committed
Update test files
1 parent 24ec512 commit c91c135

File tree

10 files changed

+8805
-8803
lines changed

10 files changed

+8805
-8803
lines changed

src/test_pownet/test_core/test_data_processor.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,35 @@
1313
class TestDataProcessor(unittest.TestCase):
1414
def test_initialization(self):
1515
# Arrange
16-
input_folder = os.getcwd()
17-
print(input_folder)
18-
model_name = "test_model"
16+
test_model_library_path = os.path.abspath(
17+
os.path.join(os.path.dirname(__file__), "..", "test_model_library")
18+
)
19+
model_name = "dummy"
1920
year = 2024
2021
frequency = 50
2122

2223
# Act
2324
processor = DataProcessor(
24-
input_folder=input_folder,
25+
input_folder=test_model_library_path,
2526
model_name=model_name,
2627
year=year,
2728
frequency=frequency,
2829
)
2930

31+
processor.execute_data_pipeline()
32+
3033
# Assert
3134
self.assertEqual(processor.model_name, model_name)
3235
self.assertEqual(processor.year, year)
3336
self.assertEqual(processor.frequency, frequency)
3437
self.assertEqual(processor.wavelength, 6000)
3538
self.assertEqual(
3639
processor.model_folder,
37-
os.path.join(get_model_dir(), input_folder, model_name),
40+
os.path.join(get_model_dir(), test_model_library_path, model_name),
3841
)
3942
# Timeseries should have 8760 rows
4043
self.assertEqual(processor.cycle_map, {})
4144
self.assertEqual(processor.thermal_derate_factors.shape[0], 8760)
42-
self.assertEqual(processor.marginal_costs.shape[0], 8760)
4345

4446

4547
if __name__ == "__main__":

src/test_pownet/test_data_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pownet.data_utils import calc_remaining_on_duration, calc_remaining_off_duration
55

66

7-
class TestCalcMinOnlineDuration(unittest.TestCase):
7+
class TestCalcMinOnlineDuration1(unittest.TestCase):
88

99
def test_startup_within_horizon(self):
1010
"""Test case where a unit has a startup within the simulation horizon.
@@ -70,7 +70,7 @@ def test_startup_outside_horizon(self):
7070
self.assertEqual(result, expected_output)
7171

7272

73-
class TestCalcMinOnlineDuration(unittest.TestCase):
73+
class TestCalcMinOnlineDuration2(unittest.TestCase):
7474

7575
def test_shutdown_within_horizon(self):
7676
"""Test case where a unit has a shutdown within the simulation horizon.

0 commit comments

Comments
 (0)