Skip to content

Commit

Permalink
FORMAT tests - run black to format package
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnVonNeumann committed Jun 8, 2024
1 parent eac12c2 commit 7aa7b08
Show file tree
Hide file tree
Showing 20 changed files with 1,130 additions and 433 deletions.
30 changes: 25 additions & 5 deletions tests/assurance/test_assurance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import pytest

from pathfinder_framework.assurance.assurance import (
Assurance, Coverage, Level, Boundary
Assurance,
Coverage,
Level,
Boundary,
)
from pathfinder_framework.datetime import DateTime

Expand All @@ -13,15 +16,23 @@ def test_assurance_init():


def test_assurance_to_dict():
assurance = Assurance(True, "My Auditor", Coverage.PCF_SYSTEM, Level.LIMITED, Boundary.CRADLE_TO_GATE, DateTime("2022-12-08T14:47:32Z"), "ISO 14044")
assurance = Assurance(
True,
"My Auditor",
Coverage.PCF_SYSTEM,
Level.LIMITED,
Boundary.CRADLE_TO_GATE,
DateTime("2022-12-08T14:47:32Z"),
"ISO 14044",
)
expected_dict = {
"assurance": True,
"provider_name": "My Auditor",
"coverage": "PCF system",
"level": "limited",
"boundary": "Cradle-to-Gate",
"completed_at": "2022-12-08T14:47:32Z",
"standard_name": "ISO 14044"
"standard_name": "ISO 14044",
}
assert assurance.to_dict() == expected_dict

Expand Down Expand Up @@ -62,7 +73,13 @@ def test_assurance_init_with_invalid_boundary():


def test_assurance_init_with_valid_enum_values():
assurance = Assurance(True, "My Auditor", coverage=Coverage.PCF_SYSTEM, level=Level.LIMITED, boundary=Boundary.GATE_TO_GATE)
assurance = Assurance(
True,
"My Auditor",
coverage=Coverage.PCF_SYSTEM,
level=Level.LIMITED,
boundary=Boundary.GATE_TO_GATE,
)
assert assurance.coverage == Coverage.PCF_SYSTEM
assert assurance.level == Level.LIMITED
assert assurance.boundary == Boundary.GATE_TO_GATE
Expand Down Expand Up @@ -92,7 +109,10 @@ def test_assurance_init_with_invalid_provider_name(provider_name):
assert str(excinfo.value) == "provider_name must be a string"


@pytest.mark.parametrize("completed_at", [DateTime("2022-12-08T14:47:32Z"), DateTime("2023-01-01T00:00:00Z"), None])
@pytest.mark.parametrize(
"completed_at",
[DateTime("2022-12-08T14:47:32Z"), DateTime("2023-01-01T00:00:00Z"), None],
)
def test_assurance_init_with_valid_completed_at(completed_at):
Assurance(True, "My Auditor", completed_at=completed_at)

Expand Down
12 changes: 7 additions & 5 deletions tests/carbon_footprint/test_biogenic_accounting_methodology.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import pytest

from pathfinder_framework.carbon_footprint.biogenic_accounting_methodology import BiogenicAccountingMethodology
from pathfinder_framework.carbon_footprint.biogenic_accounting_methodology import (
BiogenicAccountingMethodology,
)


def test_biogenic_accounting_methodology_values():
assert BiogenicAccountingMethodology.PEF.value == 'PEF'
assert BiogenicAccountingMethodology.ISO.value == 'ISO'
assert BiogenicAccountingMethodology.GHGP.value == 'GHGP'
assert BiogenicAccountingMethodology.QUANTIS.value == 'Quantis'
assert BiogenicAccountingMethodology.PEF.value == "PEF"
assert BiogenicAccountingMethodology.ISO.value == "ISO"
assert BiogenicAccountingMethodology.GHGP.value == "GHGP"
assert BiogenicAccountingMethodology.QUANTIS.value == "Quantis"

with pytest.raises(AttributeError):
assert BiogenicAccountingMethodology.Invalid
Loading

0 comments on commit 7aa7b08

Please sign in to comment.