Skip to content

Commit 4dc257f

Browse files
committed
clean up
1 parent af3625e commit 4dc257f

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

astroquery/mast/missions.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def mission(self):
7575

7676
@mission.setter
7777
def mission(self, value):
78-
# Need to update the service parameters if the mission is changed
79-
self._mission = value.lower()
78+
# Setter that updates the service parameters if the mission is changed
79+
self._mission = value.lower() # case-insensitive
8080
self._service_api_connection.set_service_params(self.service_dict, f'search/{self.mission}')
8181

8282
def _parse_result(self, response, *, verbose=False): # Used by the async_to_sync decorator functionality
@@ -100,7 +100,7 @@ def _parse_result(self, response, *, verbose=False): # Used by the async_to_syn
100100
if self.service == self._search:
101101
results = self._service_api_connection._parse_result(response, verbose, data_key='results')
102102
elif self.service == self._list_products:
103-
# Results from list_products endpoint need to be handled differently
103+
# Results from post_list_products endpoint need to be handled differently
104104
results = Table(response.json()['products'])
105105

106106
if len(results) >= self.limit:
@@ -510,8 +510,9 @@ def download_file(self, uri, *, local_path=None, cache=True, verbose=True):
510510
if err.response.status_code == 401:
511511
no_auth_msg = f'You are not authorized to download from {data_url}.'
512512
if self._authenticated:
513-
no_auth_msg += ('\nPlease check your authentication token. You can generate a new '
514-
'token at https://auth.mast.stsci.edu/token?suggested_name=Astroquery&'
513+
no_auth_msg += ('\nYou do not have access to download this data, or your authentication '
514+
'token may be expired. You can generate a new token at '
515+
'https://auth.mast.stsci.edu/token?suggested_name=Astroquery&'
515516
'suggested_scope=mast:exclusive_access')
516517
else:
517518
no_auth_msg += ('\nPlease authenticate yourself using the `~astroquery.mast.MastMissions.login` '

astroquery/mast/services.py

-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ def __init__(self, session=None):
130130

131131
self.TIMEOUT = conf.timeout
132132

133-
self._column_configs = {} # Dict to hold column configurations for services
134-
135133
def set_service_params(self, service_dict, service_name="", server_prefix=False):
136134
"""
137135
Initialize the request url and available queries for a given service.

astroquery/mast/tests/test_mast.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def test_missions_download_no_auth(patch_post, caplog):
397397
assert 'HTTPError' in result[1]
398398
with caplog.at_level('WARNING', logger='astroquery'):
399399
assert 'You are not authorized to download' in caplog.text
400-
assert 'Please check your authentication token' in caplog.text
400+
assert 'You do not have access to download this data' in caplog.text
401401

402402

403403
def test_missions_get_dataset_kwd(patch_post, caplog):

0 commit comments

Comments
 (0)