Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

position.py 1.5 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/usr/bin/env python3
  2. from .utils import (
  3. execute,
  4. KOSMORRO,
  5. )
  6. def check_command_return(result):
  7. assert result.is_successful()
  8. assert (
  9. result.stdout
  10. == """Monday, January 27, 2020
  11. Object Rise time Culmination time Set time
  12. -------- ----------- ------------------ ----------
  13. Sun 7:31 AM 12:01 PM 4:30 PM
  14. Moon 9:06 AM 2:09 PM 7:13 PM
  15. Mercury 8:10 AM 12:49 PM 5:28 PM
  16. Venus 9:01 AM 2:35 PM 8:10 PM
  17. Mars 4:19 AM 8:23 AM 12:28 PM
  18. Jupiter 6:15 AM 10:18 AM 2:21 PM
  19. Saturn 6:56 AM 11:09 AM 3:22 PM
  20. Uranus 10:21 AM 5:25 PM 12:33 AM
  21. Neptune 9:01 AM 2:36 PM 8:10 PM
  22. Pluto 6:57 AM 11:04 AM 3:11 PM
  23. Moon phase: New Moon
  24. First Quarter on Sunday, February 2, 2020 at 1:41 AM
  25. Expected events:
  26. 8:00 PM Venus and Neptune are in conjunction
  27. Note: All the hours are given in UTC.
  28. """
  29. )
  30. def test_with_position():
  31. result = execute(
  32. KOSMORRO + ["--latitude=50.5876", "--longitude=3.0624", "-d2020-01-27"]
  33. )
  34. check_command_return(result)
  35. def test_with_position_env_vars():
  36. check_command_return(
  37. execute(
  38. KOSMORRO + ["-d2020-01-27"],
  39. environment={
  40. "KOSMORRO_LATITUDE": "50.5876",
  41. "KOSMORRO_LONGITUDE": "3.0624",
  42. },
  43. )
  44. )