예제 #1
0
    def test_get_apod_default_today(self, get_mock):
        get_mock.return_value = self.response_mock

        Nasapi.get_apod()

        assert get_mock.call_args[0][0] == 'https://api.nasa.gov/planetary/apod'
        assert get_mock.call_args[0][1] == {'date': None, 'api_key': 'testkey', 'hd': False}
예제 #2
0
    def test_get_apod_specified(self, get_mock):
        get_mock.return_value = self.response_mock

        dt = date(2015, 10, 22)
        Nasapi.get_apod(date=dt, hd=True)

        assert get_mock.call_args[0][0] == 'https://api.nasa.gov/planetary/apod'
        assert get_mock.call_args[0][1] == {'date': '2015-10-22', 'api_key': 'testkey', 'hd': True}