Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

153 Zeilen
4.2 KiB

  1. #!/usr/bin/env python3
  2. from .utils import (
  3. execute,
  4. KOSMORRO,
  5. )
  6. import tempfile
  7. from os import path, environ
  8. from sys import platform
  9. def test_json_output():
  10. result = execute(
  11. KOSMORRO + ["--position=50.5876,3.0624", "-d2020-01-27", "--format=json"]
  12. )
  13. assert result.is_successful()
  14. assert (
  15. result.stdout
  16. == """{
  17. "ephemerides": [
  18. {
  19. "object": {
  20. "identifier": "SUN",
  21. "type": "STAR",
  22. "radius": 696342
  23. },
  24. "rise_time": "2020-01-27T07:31:00",
  25. "culmination_time": "2020-01-27T12:01:00",
  26. "set_time": "2020-01-27T16:30:00"
  27. },
  28. {
  29. "object": {
  30. "identifier": "MOON",
  31. "type": "SATELLITE",
  32. "radius": 1737.4
  33. },
  34. "rise_time": "2020-01-27T09:06:00",
  35. "culmination_time": "2020-01-27T14:09:00",
  36. "set_time": "2020-01-27T19:13:00"
  37. },
  38. {
  39. "object": {
  40. "identifier": "MERCURY",
  41. "type": "PLANET",
  42. "radius": 2439.7
  43. },
  44. "rise_time": "2020-01-27T08:10:00",
  45. "culmination_time": "2020-01-27T12:49:00",
  46. "set_time": "2020-01-27T17:28:00"
  47. },
  48. {
  49. "object": {
  50. "identifier": "VENUS",
  51. "type": "PLANET",
  52. "radius": 6051.8
  53. },
  54. "rise_time": "2020-01-27T09:01:00",
  55. "culmination_time": "2020-01-27T14:35:00",
  56. "set_time": "2020-01-27T20:10:00"
  57. },
  58. {
  59. "object": {
  60. "identifier": "MARS",
  61. "type": "PLANET",
  62. "radius": 3396.2
  63. },
  64. "rise_time": "2020-01-27T04:19:00",
  65. "culmination_time": "2020-01-27T08:23:00",
  66. "set_time": "2020-01-27T12:28:00"
  67. },
  68. {
  69. "object": {
  70. "identifier": "JUPITER",
  71. "type": "PLANET",
  72. "radius": 71492
  73. },
  74. "rise_time": "2020-01-27T06:15:00",
  75. "culmination_time": "2020-01-27T10:18:00",
  76. "set_time": "2020-01-27T14:21:00"
  77. },
  78. {
  79. "object": {
  80. "identifier": "SATURN",
  81. "type": "PLANET",
  82. "radius": 60268
  83. },
  84. "rise_time": "2020-01-27T06:56:00",
  85. "culmination_time": "2020-01-27T11:09:00",
  86. "set_time": "2020-01-27T15:22:00"
  87. },
  88. {
  89. "object": {
  90. "identifier": "URANUS",
  91. "type": "PLANET",
  92. "radius": 25559
  93. },
  94. "rise_time": "2020-01-27T10:21:00",
  95. "culmination_time": "2020-01-27T17:25:00",
  96. "set_time": "2020-01-27T00:33:00"
  97. },
  98. {
  99. "object": {
  100. "identifier": "NEPTUNE",
  101. "type": "PLANET",
  102. "radius": 24764
  103. },
  104. "rise_time": "2020-01-27T09:01:00",
  105. "culmination_time": "2020-01-27T14:36:00",
  106. "set_time": "2020-01-27T20:10:00"
  107. },
  108. {
  109. "object": {
  110. "identifier": "PLUTO",
  111. "type": "PLANET",
  112. "radius": 1185
  113. },
  114. "rise_time": "2020-01-27T06:57:00",
  115. "culmination_time": "2020-01-27T11:04:00",
  116. "set_time": "2020-01-27T15:11:00"
  117. }
  118. ],
  119. "moon_phase": {
  120. "phase": "NEW_MOON",
  121. "time": "2020-01-24T21:41:59.705921+00:00",
  122. "next": {
  123. "phase": "FIRST_QUARTER",
  124. "time": "2020-02-02T01:41:40.282275+00:00"
  125. }
  126. },
  127. "events": [
  128. {
  129. "objects": [
  130. {
  131. "identifier": "VENUS",
  132. "type": "PLANET",
  133. "radius": 6051.8
  134. },
  135. {
  136. "identifier": "NEPTUNE",
  137. "type": "PLANET",
  138. "radius": 24764
  139. }
  140. ],
  141. "EventType": "CONJUNCTION",
  142. "starts_at": "2020-01-27T20:00:23.242750+00:00",
  143. "ends_at": null,
  144. "details": null
  145. }
  146. ]
  147. }
  148. """
  149. )