tests: Fix trivial sorting issue

We've seen an ordering issue pop up occasionally in the CI. Resolve it.

Change-Id: I4dd10268b673c260ac0894fac92cd8bea9e626f4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2024-04-25 10:20:59 +01:00
parent a79cb608b0
commit 837a3dc015
2 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ def update_tags_in_args(parsed_args, obj, args):
args['tags'] = [] args['tags'] = []
obj.tags = [] obj.tags = []
if parsed_args.remove_tag: if parsed_args.remove_tag:
args['tags'] = list(set(obj.tags) - set(parsed_args.remove_tag)) args['tags'] = sorted(set(obj.tags) - set(parsed_args.remove_tag))
return return
if parsed_args.tags: if parsed_args.tags:
args['tags'] = list(set(obj.tags).union(set(parsed_args.tags))) args['tags'] = sorted(set(obj.tags).union(set(parsed_args.tags)))

View File

@ -1130,7 +1130,7 @@ class TestProjectSet(TestProject):
# Set expected values. new tag is added to original tags for update. # Set expected values. new tag is added to original tags for update.
kwargs = { kwargs = {
'name': 'qwerty', 'name': 'qwerty',
'tags': list(set(['tag1', 'tag2', 'tag3', 'foo'])), 'tags': sorted(set(['tag1', 'tag2', 'tag3', 'foo'])),
} }
# ProjectManager.update(project, name=, domain=, description=, # ProjectManager.update(project, name=, domain=, description=,
# enabled=, **kwargs) # enabled=, **kwargs)