Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoMinheere committed Nov 26, 2024
1 parent 0dbd5b1 commit 9ccdac0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions taxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def calc_multiplier(weight: int, cut_off: int = 900, step: int = 100) -> int:
return round((weight - cut_off) // step)
return 0


def calc_fuel_tax(energy_source: EnergySource, weight: int) -> float:
"""Calculate extra fuel tax based on energy source."""
if energy_source == EnergySource.DIESEL:
Expand Down Expand Up @@ -127,15 +128,13 @@ def calculate_tax(
else:
base_tax *= 1.0 # 100% of base tax


# Fuel-specific tax
fuel_tax = calc_fuel_tax(energy_source, rounded_weight)
base_tax += fuel_tax

# Apply inflation adjustment if applicable
if year in INFLATION:
base_tax *= (1 + INFLATION[year])

base_tax *= 1 + INFLATION[year]

# Provincial opcenten tax
opcenten = calc_opcenten(rounded_weight, province, year)
Expand Down
5 changes: 3 additions & 2 deletions tests/test_mrb.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def test_calculate_tax_lpg_g3(self):

self.assertEqual(
calculate_tax(energy_source, weight, province, self.YEAR), result
)
)

def test_calculate_tax_lpg_g3_without_fuel_tax(self):
# Test cases for calculate_tax
weight = 720
Expand Down Expand Up @@ -180,5 +180,6 @@ def test_calculate_tax_other_with_excess_weight(self):
calculate_tax(energy_source, weight, province, self.YEAR), result
)


if __name__ == "__main__":
unittest.main()

0 comments on commit 9ccdac0

Please sign in to comment.