Skip to content

Commit

Permalink
Empty commit
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquesebastiao committed Jan 23, 2024
1 parent e5049c0 commit e513c9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
7 changes: 3 additions & 4 deletions skyport/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from datetime import datetime
from pprint import pprint

import requests
import typer
Expand All @@ -15,7 +16,7 @@

# Settings for consuming Nasa API
HOST = 'https://api.nasa.gov/'
NASA_API_KEY = os.getenv('NASAAPI_KEY', 'DEMO_KEY')
NASA_API_KEY = os.getenv('NASA_API_KEY', 'DEMO_KEY')
date_now = datetime.now().date().isoformat()

app = typer.Typer(
Expand Down Expand Up @@ -164,7 +165,5 @@ def apod(
)
raise typer.Exit(code=1)
else:
console.print(response.status_code)
console.print(response.headers)
console.print(response.json())
console.print(WARNING)
pprint(response.json())
11 changes: 1 addition & 10 deletions tests/test_apod.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
import os
from os import getenv
from pprint import pprint

import requests

from .test_base import CliUnitTest, check_result_error


class ApodTest(CliUnitTest):
def test_return_with_remaining_option_of_apod(self):
print('\n' + '>>>>> ' + getenv('NASA_API_KEY'))
response = requests.get('https://api.nasa.gov/planetary/apod?api_key=' + getenv('NASA_API_KEY'))
print(response.status_code)
pprint(response.json())
pprint(response.headers)
result = self.invoke('apod', '--date 2024-01-01', '-r')
if result.exit_code == 0:
print('\n'+result.output)
print('\n' + result.output)
self.assertIn('Remain', result.output)
check_result_error(result)

Expand Down
3 changes: 0 additions & 3 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.runner = CliRunner()

def setUp(self):
os.environ['NASA_API_KEY'] = '0F0KeeYZ7axdckLa9VyRQZGTslLkkl6tmbdcapaj'

def invoke(self, *flags: str) -> Result:
"""
Simplify the invoke of the app for tests
Expand Down

0 comments on commit e513c9b

Please sign in to comment.