Skip to content

Commit c072559

Browse files
at88mphbsipocz
authored andcommitted
Linter fixes.
1 parent ad29f93 commit c072559

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

astroquery/alma/tests/test_alma_auth.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import json
66
import pytest
7-
from unittest.mock import patch, Mock
7+
from unittest.mock import Mock
88

99

1010
def test_host():
@@ -18,6 +18,7 @@ def _requests_mock_ok(method, url, **kwargs):
1818
test_subject._request = Mock(side_effect=_requests_mock_ok)
1919
assert test_subject.host == 'almaexample.com'
2020

21+
2122
def test_host_default():
2223
def _requests_mock_ok(method, url, **kwargs):
2324
response = Mock()
@@ -28,6 +29,7 @@ def _requests_mock_ok(method, url, **kwargs):
2829
test_subject._request = Mock(side_effect=_requests_mock_ok)
2930
assert test_subject.host == 'asa.alma.cl'
3031

32+
3133
def test_host_err():
3234
def _requests_mock_err(method, url, **kwargs):
3335
response = Mock()
@@ -40,14 +42,14 @@ def _requests_mock_err(method, url, **kwargs):
4042
with pytest.raises(LoginError):
4143
test_subject.host
4244

45+
4346
def test_login_bad_error():
4447
def _response_json():
4548
obj = {
4649
'error': 'Badness',
4750
'error_description': 'Something very bad'
4851
}
49-
return obj
50-
# return json.dumps(obj, indent = 4)
52+
return json.dumps(obj, indent=4)
5153

5254
def _requests_mock_err(method, url, **kwargs):
5355
response = Mock()
@@ -64,12 +66,13 @@ def _requests_mock_err(method, url, **kwargs):
6466
test_subject.login('TESTUSER', 'TESTPASS')
6567
assert 'Could not log in to ALMA authorization portal' in e.value.args[0]
6668

69+
6770
def test_login_missing_token():
6871
def _response_json():
6972
obj = {
7073
'irrlevant': 'Weird',
7174
}
72-
return json.dumps(obj, indent = 4)
75+
return json.dumps(obj, indent=4)
7376

7477
def _requests_mock_err(method, url, **kwargs):
7578
response = Mock()
@@ -87,12 +90,13 @@ def _requests_mock_err(method, url, **kwargs):
8790

8891
assert 'No error from server, but missing access token from host' in e.value.args[0]
8992

93+
9094
def test_login_success():
9195
def _response_json():
9296
obj = {
9397
'access_token': 'MYTOKEN'
9498
}
95-
return json.dumps(obj, indent = 4)
99+
return json.dumps(obj, indent=4)
96100

97101
def _requests_mock_good(method, url, **kwargs):
98102
response = Mock()

0 commit comments

Comments
 (0)