phase-of-the-moon/tests/test_phase_of_the_moon.py
Zoé Cassiopée Gauthier ada1e96cf8 Initial commit
2024-11-01 17:46:09 -04:00

24 lines
717 B
Python

# Copyright 2024 Zoé Cassiopée Gauthier.
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
import datetime as dt
from phase_of_the_moon.main import phase_of_the_moon, NEW_MOON, FULL_MOON
def test_new_moon():
local_time = dt.datetime(1996, 9, 13)
assert phase_of_the_moon(local_time) == NEW_MOON
def test_full_moon():
local_time = dt.datetime(1998, 3, 13)
assert phase_of_the_moon(local_time) == FULL_MOON
def test_any_other_moon_phase():
local_time = dt.datetime(2000, 1, 1)
moon_phase = phase_of_the_moon(local_time)
assert moon_phase != FULL_MOON
assert moon_phase != NEW_MOON