Skip to content

Commit 0e39716

Browse files
committed
remove some comments, still not done with the PR
1 parent fc097b3 commit 0e39716

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

astroquery/higal/core.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,14 @@ def query_region_async(self, coordinates, radius,
100100

101101
return response
102102

103-
# as we mentioned earlier use various python regular expressions, etc
104-
# to create the dict of HTTP request parameters by parsing the user
105-
# entered values. For cleaner code keep this as a separate private method:
106-
107103
def _args_to_payload(self, coords=None, name=None, radius=10*u.arcmin,
108104
catalog_id=None, catalog_query=True, *args, **kwargs):
109105

110106
if not hasattr(self, '_session_id'):
111107
# set up session: get cookies
112108
initial_response = self._request('GET', self.URL, cache=False,
113109
timeout=self.TIMEOUT)
110+
initial_response.raise_for_status()
114111

115112
# multiple cookies are returned
116113
self._session_id = self._session.cookies.values()[1]

astroquery/higal/tests/test_higal.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
from __future__ import print_function
33

4-
# astroquery uses the pytest framework for testing
5-
# this is already available in astropy and does
6-
# not require a separate install. Import it using:
74
import pytest
85

9-
# It would be best if tests are separated in two
10-
# modules. This module performs tests on local data
11-
# by mocking HTTP requests and responses. To test the
12-
# same functions on the remote server, put the relevant
13-
# tests in the 'test_module_remote.py'
14-
15-
# Now import other commonly used modules for tests
166
import os
177
import requests
188

@@ -23,10 +13,8 @@
2313

2414
from ...utils.testing_tools import MockResponse
2515

26-
# finally import the module which is to be tested
27-
# and the various configuration items created
28-
from ... import template_module
29-
from ...template_module import conf
16+
from ... import higal
17+
from ...higal import conf
3018

3119
# Local tests should have the corresponding data stored
3220
# in the ./data folder. This is the actual HTTP response
@@ -71,15 +59,12 @@ def patch_request(request):
7159
mp = request.getfixturevalue("monkeypatch")
7260
except AttributeError: # pytest < 3
7361
mp = request.getfuncargvalue("monkeypatch")
74-
mp.setattr(template_module.core.TemplateClass, '_request',
62+
mp.setattr(higal.core.HiGalClass, '_request',
7563
nonremote_request)
7664
return mp
7765

7866

7967
# finally test the methods using the mock HTTP response
8068
def test_query_object(patch_request):
81-
result = template_module.core.TemplateClass().query_object('m1')
69+
result = higal.core.HiGalClass().query_object('m1')
8270
assert isinstance(result, Table)
83-
84-
# similarly fill in tests for each of the methods
85-
# look at tests in existing modules for more examples

0 commit comments

Comments
 (0)