Skip to content

Commit

Permalink
refactor: use builders in venting emitter tests (#714)
Browse files Browse the repository at this point in the history
* refactor: use builders in venting emitter tests
  • Loading branch information
frodehk authored Nov 29, 2024
1 parent ad17d3c commit da54989
Show file tree
Hide file tree
Showing 9 changed files with 315 additions and 541 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lib-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
id: total
if: matrix.python-version == '3.11'
run: |
poetry run python -m coverage report --fail-under 50
poetry run python -m coverage report --fail-under 45
poetry run python -m coverage html -d build/
poetry run python -m coverage json -o build/coverage.json
echo '# Code Coverage Report\n See the index.html for a more detailed report.\n' >> build/README.md
Expand Down
45 changes: 0 additions & 45 deletions src/libecalc/fixtures/cases/ltp_export/utilities.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/libecalc/fixtures/cases/venting_emitters/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .venting_emitter_yaml import venting_emitter_yaml_factory

208 changes: 0 additions & 208 deletions src/libecalc/fixtures/cases/venting_emitters/venting_emitter_yaml.py

This file was deleted.

11 changes: 7 additions & 4 deletions src/libecalc/testing/yaml_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,15 @@ def with_test_data(self) -> Self:
return self

def with_rate_and_emission_names_and_factors(
self, rate: YamlExpressionType, names: list[str], factors: list[YamlExpressionType]
self,
rate: YamlExpressionType,
names: list[str],
factors: list[YamlExpressionType],
unit: YamlOilRateUnits = YamlOilRateUnits.STANDARD_CUBIC_METER_PER_DAY,
rate_type: RateType = RateType.STREAM_DAY,
) -> Self:
self.volume = YamlVentingVolume(
rate=YamlOilVolumeRate(
value=rate, unit=YamlOilRateUnits.STANDARD_CUBIC_METER_PER_DAY, type=RateType.STREAM_DAY
),
rate=YamlOilVolumeRate(value=rate, unit=unit, type=rate_type),
emissions=[
YamlVentingVolumeEmission(name=name, emission_factor=factor) for name, factor in zip(names, factors)
],
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path
from typing import Optional, cast


import pytest
import yaml

Expand Down
2 changes: 0 additions & 2 deletions tests/libecalc/presentation/exporter/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import pytest
from datetime import datetime
from typing import Optional, Union

from libecalc.common.time_utils import Period
from libecalc.presentation.yaml.yaml_entities import MemoryResource
from libecalc.testing.yaml_builder import (
YamlFuelTypeBuilder,
Expand Down
Loading

0 comments on commit da54989

Please sign in to comment.