| @@ -13,10 +13,10 @@ def test_with_date(): | |||||
| == """Monday, January 27, 2020 | == """Monday, January 27, 2020 | ||||
| Moon phase: New Moon | Moon phase: New Moon | ||||
| First Quarter on Sunday, February 2, 2020 at 1:41 AM | |||||
| First Quarter on Sunday, February 2, 2020 at 1:41 AM | |||||
| Expected events: | Expected events: | ||||
| 8:00 PM Venus and Neptune are in conjunction | |||||
| 8:00 PM Venus and Neptune are in conjunction | |||||
| Note: All the hours are given in UTC. | Note: All the hours are given in UTC. | ||||
| """ | """ | ||||
| @@ -1,6 +1,6 @@ | |||||
| #!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
| from sys import version_info | |||||
| from sys import version_info as python_version | |||||
| from .utils import ( | from .utils import ( | ||||
| execute, | execute, | ||||
| KOSMORRO, | KOSMORRO, | ||||
| @@ -19,7 +19,7 @@ def test_run_without_argument(): | |||||
| print(stdout) | print(stdout) | ||||
| # It always starts with the current date, an empty line and the current and next Moon date: | # It always starts with the current date, an empty line and the current and next Moon date: | ||||
| assert stdout[0] == format_date(date.today(), "full") | |||||
| assert stdout[0] == format_date(date.today(), "full", "EN") | |||||
| assert stdout[1] == "" | assert stdout[1] == "" | ||||
| assert CURRENT_MOON_PHASE_PATTERN.match(stdout[2]) | assert CURRENT_MOON_PHASE_PATTERN.match(stdout[2]) | ||||
| assert NEXT_MOON_PHASE_PATTERN.match(stdout[3]) | assert NEXT_MOON_PHASE_PATTERN.match(stdout[3]) | ||||
| @@ -31,15 +31,13 @@ def test_run_without_argument(): | |||||
| def test_help_message(): | def test_help_message(): | ||||
| python_version = (version_info.major, version_info.minor) | |||||
| for arg in ["--help", "-h"]: | for arg in ["--help", "-h"]: | ||||
| result = execute(KOSMORRO + [arg]) | result = execute(KOSMORRO + [arg]) | ||||
| assert result.is_successful() | assert result.is_successful() | ||||
| # Options header has changed from "optional arguments" to "options" in Python 3.10. | # Options header has changed from "optional arguments" to "options" in Python 3.10. | ||||
| options_header = ( | options_header = ( | ||||
| "options" if python_version == (3, 10) else "optional arguments" | |||||
| "optional arguments" if python_version.minor < 10 else "options" | |||||
| ) | ) | ||||
| assert ( | assert ( | ||||
| @@ -14,22 +14,22 @@ def check_command_return(result): | |||||
| Object Rise time Culmination time Set time | Object Rise time Culmination time Set time | ||||
| -------- ----------- ------------------ ---------- | -------- ----------- ------------------ ---------- | ||||
| Sun 7:31 AM 12:01 PM 4:30 PM | |||||
| Moon 9:06 AM 2:09 PM 7:13 PM | |||||
| Mercury 8:10 AM 12:49 PM 5:28 PM | |||||
| Venus 9:01 AM 2:35 PM 8:10 PM | |||||
| Mars 4:19 AM 8:23 AM 12:28 PM | |||||
| Jupiter 6:15 AM 10:18 AM 2:21 PM | |||||
| Saturn 6:56 AM 11:09 AM 3:22 PM | |||||
| Uranus 10:21 AM 5:25 PM 12:33 AM | |||||
| Neptune 9:01 AM 2:36 PM 8:10 PM | |||||
| Pluto 6:57 AM 11:04 AM 3:11 PM | |||||
| Sun 7:31 AM 12:01 PM 4:30 PM | |||||
| Moon 9:06 AM 2:09 PM 7:13 PM | |||||
| Mercury 8:10 AM 12:49 PM 5:28 PM | |||||
| Venus 9:01 AM 2:35 PM 8:10 PM | |||||
| Mars 4:19 AM 8:23 AM 12:28 PM | |||||
| Jupiter 6:15 AM 10:18 AM 2:21 PM | |||||
| Saturn 6:56 AM 11:09 AM 3:22 PM | |||||
| Uranus 10:21 AM 5:25 PM 12:33 AM | |||||
| Neptune 9:01 AM 2:36 PM 8:10 PM | |||||
| Pluto 6:57 AM 11:04 AM 3:11 PM | |||||
| Moon phase: New Moon | Moon phase: New Moon | ||||
| First Quarter on Sunday, February 2, 2020 at 1:41 AM | |||||
| First Quarter on Sunday, February 2, 2020 at 1:41 AM | |||||
| Expected events: | Expected events: | ||||
| 8:00 PM Venus and Neptune are in conjunction | |||||
| 8:00 PM Venus and Neptune are in conjunction | |||||
| Note: All the hours are given in UTC. | Note: All the hours are given in UTC. | ||||
| """ | """ | ||||
| @@ -13,10 +13,10 @@ def check_command_return_t_plus_one(result): | |||||
| == """Monday, January 27, 2020 | == """Monday, January 27, 2020 | ||||
| Moon phase: New Moon | Moon phase: New Moon | ||||
| First Quarter on Sunday, February 2, 2020 at 2:41 AM | |||||
| First Quarter on Sunday, February 2, 2020 at 2:41 AM | |||||
| Expected events: | Expected events: | ||||
| 9:00 PM Venus and Neptune are in conjunction | |||||
| 9:00 PM Venus and Neptune are in conjunction | |||||
| Note: All the hours are given in the UTC+1 timezone. | Note: All the hours are given in the UTC+1 timezone. | ||||
| """ | """ | ||||
| @@ -30,10 +30,10 @@ def check_command_return_t_minus_one(result): | |||||
| == """Monday, January 27, 2020 | == """Monday, January 27, 2020 | ||||
| Moon phase: New Moon | Moon phase: New Moon | ||||
| First Quarter on Sunday, February 2, 2020 at 12:41 AM | |||||
| First Quarter on Sunday, February 2, 2020 at 12:41 AM | |||||
| Expected events: | Expected events: | ||||
| 7:00 PM Venus and Neptune are in conjunction | |||||
| 7:00 PM Venus and Neptune are in conjunction | |||||
| Note: All the hours are given in the UTC-1 timezone. | Note: All the hours are given in the UTC-1 timezone. | ||||
| """ | """ | ||||
| @@ -26,7 +26,7 @@ NEXT_MOON_PHASE_PATTERN = re.compile( | |||||
| r"on ((Monday)|(Tuesday)|(Wednesday)|(Thursday)|(Friday)|(Saturday)|(Sunday)), " | r"on ((Monday)|(Tuesday)|(Wednesday)|(Thursday)|(Friday)|(Saturday)|(Sunday)), " | ||||
| r"((January)|(February)|(March)|(April)|(May)|(June)|" | r"((January)|(February)|(March)|(April)|(May)|(June)|" | ||||
| r"(July)|(August)|(September)|(October)|(November)|(December)) " | r"(July)|(August)|(September)|(October)|(November)|(December)) " | ||||
| r"[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2} [AP]M$" | |||||
| r"[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2} [AP]M$" | |||||
| ) | ) | ||||