Skip to content

Commit

Permalink
Fix tests for previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cmutel committed Jul 23, 2024
1 parent c4faf28 commit 6d4ae78
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
26 changes: 23 additions & 3 deletions tests/integration/test_brightway_export_allocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,23 @@ def test_basic_header_extraction(fixtures_dir):
"comment": "INDIA",
"functional": True,
"line_no": 211,
"mf_allocated": True,
"mf_manual_input_product": False,
"name": "Rice, at farm (WFLDB 3.0)/IN U",
"properties": {"manual_allocation": 95.8},
"type": "production",
"unit": "kg",
"waste_type": "not defined",
}
assert allocated["exchanges"][0] == expected
for key, value in expected.items():
assert allocated["exchanges"][0][key] == value

assert allocated["exchanges"][0]["input"]
assert allocated["exchanges"][0]["mf_allocated_process_code"]
assert (
allocated["exchanges"][0]["input"][1]
== allocated["exchanges"][0]["mf_allocated_process_code"]
)

expected = {
"allocation": 4.2,
Expand All @@ -66,12 +76,22 @@ def test_basic_header_extraction(fixtures_dir):
"assumption that grains account for "
"92% and straw for 8% of the price.",
"functional": True,
"mf_allocated": True,
"mf_manual_input_product": False,
"line_no": 212,
"name": "Rice straw, at farm (WFLDB 3.0)/IN U",
"properties": {"manual_allocation": 4.2},
"type": "production",
"unit": "kg",
"waste_type": "not defined",
}
assert allocated["exchanges"][1] == expected
assert len(allocated["exchanges"])

for key, value in expected.items():
assert allocated["exchanges"][1][key] == value

assert allocated["exchanges"][1]["input"]
assert allocated["exchanges"][1]["mf_allocated_process_code"]
assert (
allocated["exchanges"][1]["input"][1]
== allocated["exchanges"][1]["mf_allocated_process_code"]
)
1 change: 1 addition & 0 deletions tests/integration/test_process_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def test_basic_header_extraction(fixtures_dir):
"decimal_separator": ",",
"delimiter": ";",
"export_platform_ids": None,
'exclude_library_processes': None,
"include_stages": None,
"kind": SimaProCSVType.processes,
"libraries": [],
Expand Down
7 changes: 7 additions & 0 deletions tests/test_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def test_basic_header_extraction(fixtures_dir):
"dayfirst": False,
"selection": "Selection (2)",
"open_project": "Bobs_burgers",
"exclude_library_processes": None,
"open_library": None,
"date_separator": "/",
"export_platform_ids": None,
Expand All @@ -46,6 +47,7 @@ def test_basic_header_extraction(fixtures_dir):
"dayfirst": True,
"selection": "Current (1)",
"open_project": None,
"exclude_library_processes": None,
"open_library": None,
"date_separator": "/",
"export_platform_ids": None,
Expand All @@ -68,6 +70,7 @@ def test_basic_header_extraction(fixtures_dir):
"dayfirst": True,
"selection": "Current (1)",
"open_project": "Dummy project",
"exclude_library_processes": None,
"open_library": None,
"date_separator": "/",
"export_platform_ids": False,
Expand All @@ -90,6 +93,7 @@ def test_basic_header_extraction(fixtures_dir):
"libraries": [],
"dayfirst": False,
"selection": "Selection (1)",
"exclude_library_processes": None,
"open_project": None,
"open_library": "Methods",
"date_separator": "-",
Expand All @@ -111,6 +115,7 @@ def test_basic_header_extraction(fixtures_dir):
"csv_version": "9.0.0",
"libraries": [],
"dayfirst": True,
"exclude_library_processes": None,
"selection": None,
"open_project": None,
"open_library": None,
Expand Down Expand Up @@ -161,6 +166,7 @@ def test_basic_header_extraction(fixtures_dir):
"dayfirst": False,
"selection": "Selection (1)",
"open_project": "AP9 pilot",
"exclude_library_processes": None,
"open_library": None,
"date_separator": "/",
"export_platform_ids": True,
Expand Down Expand Up @@ -192,6 +198,7 @@ def test_minimal_header_extraction(fixtures_dir):
"dayfirst": False,
"date_separator": "/",
"open_project": None,
"exclude_library_processes": None,
"open_library": None,
"export_platform_ids": None,
"skip_empty_fields": None,
Expand Down

0 comments on commit 6d4ae78

Please sign in to comment.