-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: do not allow control margin for simplified variable speed tra…
…in (#569) * chore: do not allow control margin for simplified variable speed train ECALC-1483
- Loading branch information
Showing
3 changed files
with
73 additions
and
1 deletion.
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
37 changes: 37 additions & 0 deletions
37
...sts/libecalc/presentation/yaml/yaml_types/models/test_yaml_simplified_compressor_train.py
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,37 @@ | ||
import pytest | ||
from libecalc.presentation.yaml.yaml_keywords import EcalcYamlKeywords | ||
from libecalc.presentation.yaml.yaml_types.models.yaml_compressor_stages import ( | ||
YamlCompressorStage, | ||
YamlCompressorStages, | ||
) | ||
from libecalc.presentation.yaml.yaml_types.models.yaml_compressor_trains import ( | ||
YamlCompatibleTrainsControlMargin, | ||
YamlSimplifiedVariableSpeedCompressorTrain, | ||
) | ||
from libecalc.presentation.yaml.yaml_types.models.yaml_enums import YamlModelType | ||
|
||
|
||
def test_control_margin_not_allowed(): | ||
stage = YamlCompressorStage( | ||
compressor_chart="compressor_chart1", | ||
inlet_temperature=25, | ||
control_margin=10, | ||
) | ||
|
||
stages = YamlCompressorStages(stages=[stage]) | ||
|
||
with pytest.raises(ValueError) as exc: | ||
YamlSimplifiedVariableSpeedCompressorTrain( | ||
name="simplified_train1", | ||
type=YamlModelType.SIMPLIFIED_VARIABLE_SPEED_COMPRESSOR_TRAIN, | ||
compressor_train=stages, | ||
fluid_model="fluid_model1", | ||
) | ||
|
||
assert ( | ||
f"simplified_train1: {EcalcYamlKeywords.models_type_compressor_train_stage_control_margin} " | ||
f"is not allowed for {EcalcYamlKeywords.models_type_compressor_train_simplified}. " | ||
f"{EcalcYamlKeywords.models_type_compressor_train_stage_control_margin} is only " | ||
f"supported for the following train-types: " | ||
f"{', '.join(YamlCompatibleTrainsControlMargin)}" | ||
) in str(exc.value) |