Преглед на файлове

chore: fix tests

pull/316/head
Jérôme Deuchnord преди 1 година
родител
ревизия
5b32006e65
променени са 5 файла, в които са добавени 22 реда и са изтрити 24 реда
  1. +2
    -2
      tests/dates.py
  2. +3
    -5
      tests/general.py
  3. +12
    -12
      tests/position.py
  4. +4
    -4
      tests/timezone.py
  5. +1
    -1
      tests/utils.py

+ 2
- 2
tests/dates.py Целия файл

@@ -13,10 +13,10 @@ def test_with_date():
== """Monday, January 27, 2020

Moon phase: New Moon
First Quarter on Sunday, February 2, 2020 at 1:41 AM
First Quarter on Sunday, February 2, 2020 at 1:41AM

Expected events:
8:00 PM Venus and Neptune are in conjunction
8:00PM Venus and Neptune are in conjunction

Note: All the hours are given in UTC.
"""


+ 3
- 5
tests/general.py Целия файл

@@ -1,6 +1,6 @@
#!/usr/bin/env python3

from sys import version_info
from sys import version_info as python_version
from .utils import (
execute,
KOSMORRO,
@@ -19,7 +19,7 @@ def test_run_without_argument():
print(stdout)

# 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 CURRENT_MOON_PHASE_PATTERN.match(stdout[2])
assert NEXT_MOON_PHASE_PATTERN.match(stdout[3])
@@ -31,15 +31,13 @@ def test_run_without_argument():


def test_help_message():
python_version = (version_info.major, version_info.minor)

for arg in ["--help", "-h"]:
result = execute(KOSMORRO + [arg])
assert result.is_successful()

# Options header has changed from "optional arguments" to "options" in Python 3.10.
options_header = (
"options" if python_version == (3, 10) else "optional arguments"
"optional arguments" if python_version.minor < 10 else "options"
)

assert (


+ 12
- 12
tests/position.py Целия файл

@@ -14,22 +14,22 @@ def check_command_return(result):

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
First Quarter on Sunday, February 2, 2020 at 1:41 AM
First Quarter on Sunday, February 2, 2020 at 1:41AM

Expected events:
8:00 PM Venus and Neptune are in conjunction
8:00PM Venus and Neptune are in conjunction

Note: All the hours are given in UTC.
"""


+ 4
- 4
tests/timezone.py Целия файл

@@ -13,10 +13,10 @@ def check_command_return_t_plus_one(result):
== """Monday, January 27, 2020

Moon phase: New Moon
First Quarter on Sunday, February 2, 2020 at 2:41 AM
First Quarter on Sunday, February 2, 2020 at 2:41AM

Expected events:
9:00 PM Venus and Neptune are in conjunction
9:00PM Venus and Neptune are in conjunction

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

Moon phase: New Moon
First Quarter on Sunday, February 2, 2020 at 12:41 AM
First Quarter on Sunday, February 2, 2020 at 12:41AM

Expected events:
7:00 PM Venus and Neptune are in conjunction
7:00PM Venus and Neptune are in conjunction

Note: All the hours are given in the UTC-1 timezone.
"""


+ 1
- 1
tests/utils.py Целия файл

@@ -26,7 +26,7 @@ NEXT_MOON_PHASE_PATTERN = re.compile(
r"on ((Monday)|(Tuesday)|(Wednesday)|(Thursday)|(Friday)|(Saturday)|(Sunday)), "
r"((January)|(February)|(March)|(April)|(May)|(June)|"
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$"
)




Зареждане…
Отказ
Запис