Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
francescpuig7 committed Sep 20, 2019
1 parent 0cc1023 commit 7cb7309
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spec/datetime/solar_hour_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from enerdata.datetime.solar_hour import convert_to_solar_hour
from enerdata.datetime.timezone import TIMEZONE
from dateutil.relativedelta import relativedelta
from expects import expect, equal
from expects import expect, equal, start_with

DIFFERENCE_HOURS = {'summer': 2, 'winter': 1}

Expand Down Expand Up @@ -37,3 +37,9 @@
solar_hour = convert_to_solar_hour(dtc)
civil_hour_to_expect = dtc - relativedelta(hours=hours)
expect(civil_hour_to_expect.hour).to(equal(solar_hour.hour))

with context("must be located"):
with it("even if the civil hour is not"):
dt = TIMEZONE.localize(datetime(2019, 11, 1, 1))
dt = convert_to_solar_hour(dt)
expect(dt.tzname()).to(start_with('UTC'))

0 comments on commit 7cb7309

Please sign in to comment.