Skip to content

Commit 545f6b7

Browse files
return 200, 'profiles': [] to non-NBM requests
1 parent eccb212 commit 545f6b7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

python/nwsc_proxy/ncp_web_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def handler(self):
5757
# otherwise, must be 'GET' operation
5858
data_source = request.args.get('dataSource', None, type=str)
5959
if data_source not in ['NBM', 'ANY']:
60-
return jsonify({'profiles': [], 'errors': [f'Invalid dataSource: {data_source}']}), 400
60+
return jsonify({'profiles': [], 'errors': []}), 200
6161

6262
profile_status = request.args.get('status', default='existing', type=str)
6363
if profile_status == 'existing':

python/nwsc_proxy/test/test_ncp_web_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ def test_events_bad_key(wrapper: AppWrapper, mock_request: Mock):
111111

112112

113113
def test_get_bad_data_source(wrapper: AppWrapper, mock_request: Mock):
114-
mock_request.args = MultiDict({'dataSource': 'A BAD DATA SOURCE'})
114+
mock_request.args = MultiDict({'dataSource': 'MYSTERY DATA SOURCE'})
115115

116116
result: tuple[Response, int] = wrapper.app.view_functions['events']()
117117

118-
assert result[1] == 400
118+
assert result[0].json['profiles'] == []
119+
assert result[1] == 200
119120

120121

121122
def test_get_bad_status(wrapper: AppWrapper, mock_request: Mock):

0 commit comments

Comments
 (0)