Skip to content

Commit

Permalink
Merge branch 'Inria-Empenn:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bclenet authored Sep 29, 2023
2 parents 0a584dd + 2836b10 commit e284b80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 1 addition & 5 deletions narps_open/utils/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_opened_issues():

# Get all opened issues
request_url = 'https://api.github.com/repos/Inria-Empenn/narps_open_pipelines/issues'
request_url += '?page={page_number}?per_page=30'
request_url += '?page={page_number}'

issues = []
page = True # Will later be replaced by a table
Expand All @@ -39,10 +39,6 @@ def get_opened_issues():
issues += page
page_number += 1

# Leave if there is only one page (in this case, the `page` query parameter has no effect)
if nb_issues < 30:
break

return issues

def get_teams_with_pipeline_files():
Expand Down
6 changes: 4 additions & 2 deletions tests/utils/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ def mocked_requests_get_4(url, params=None, **kwargs):
if 'issues' not in url:
def mocked_json():
return mocked_repo_info_4
else:
elif '?page=1' in url:
def mocked_json():
return mocked_issues_4
else:
def mocked_json():
return []

response.json = mocked_json
return response
Expand Down Expand Up @@ -189,7 +192,6 @@ def test_get_issues(mocker):

# General usecase 4 issues
mocker.patch('narps_open.utils.status.get', side_effect = mocked_requests_get_4)

issues = get_opened_issues()
assert len(issues) == 4
assert issues[0]['html_url'] == 'url_issue_2'
Expand Down

0 comments on commit e284b80

Please sign in to comment.