1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

backport_pr: add doc tests for _get_labels()

This commit is contained in:
Martine Lenders 2019-04-24 11:47:22 +02:00
parent ac60154157
commit 292c5dd730

View File

@ -33,6 +33,14 @@ BACKPORT_BRANCH = 'backport/{release}/{origbranch}'
def _get_labels(pr):
"""
>>> _get_labels({'labels': [{'name': 'test'}, {'name': 'abcd'}]})
['Process: release backport', 'abcd', 'test']
>>> _get_labels({'labels': [{'name': 'Process: release backport'}]})
['Process: release backport']
>>> _get_labels({'labels': [{'name': 'Process: needs backport'}]})
['Process: release backport']
"""
labels = {label['name'] for label in pr['labels']}
for remove in LABELS_REMOVE:
labels.discard(remove)