示例#1
0
    def test_get_assets_default_today(self, get_mock):
        get_mock.return_value = self.response_mock

        Nasapi.get_assets(52.3, 5.1)

        assert get_mock.call_args[0][0] == 'https://api.nasa.gov/planetary/earth/assets'
        assert get_mock.call_args[0][1] == {
            'lat': 52.3,
            'lon': 5.1,
            'begin': None,
            'end': None,
            'api_key': 'testkey'
        }
示例#2
0
    def test_get_assets_specified(self, get_mock):
        get_mock.return_value = self.response_mock

        begin = date(2015, 10, 22)
        end = date(2015, 11, 22)
        Nasapi.get_assets(52.3, 5.1, begin=begin, end=end)

        assert get_mock.call_args[0][0] == 'https://api.nasa.gov/planetary/earth/assets'
        assert get_mock.call_args[0][1] == {
            'lat': 52.3,
            'lon': 5.1,
            'begin': '2015-10-22',
            'end': '2015-11-22',
            'api_key': 'testkey'
        }