Skip to content

Commit

Permalink
Fix tests for compatibility with Python 3.12
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Verga <[email protected]>
  • Loading branch information
mattiaverga committed Jul 22, 2023
1 parent 0f73f1d commit 62d6bd6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bodhi-server/tests/consumers/test_signed.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@ def test_consume_from_tag_composed_by_bodhi(self, add_tag):
assert update.status == UpdateStatus.pending
assert update.pushed is False
assert update.test_gating_status == TestGatingStatus.passed
assert add_tag.not_called()
add_tag.assert_not_called()
2 changes: 1 addition & 1 deletion bodhi-server/tests/tasks/test_approve_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def test_autotime_update_zero_day_in_testing_no_gated_gets_pushed_to_rawhide(

assert add_tag.call_args_list == \
[call('f17-updates')]
assert delete_tag.not_called()
delete_tag.assert_not_called()
else:
assert remove_tag.call_args_list == \
[call(f'{from_side_tag}-signing-pending'),
Expand Down
4 changes: 2 additions & 2 deletions bodhi-server/tests/tasks/test_composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3388,9 +3388,9 @@ def test_stable_update(self, delete_tag, from_side_tag):
assert (now - update.date_pushed) < datetime.timedelta(seconds=5)
assert update.pushed
if from_side_tag:
assert delete_tag.called_with('f34-build-side-0000')
delete_tag.assert_called_with('f34-build-side-0000')
else:
assert delete_tag.not_called()
delete_tag.assert_not_called()

def test_testing_update(self):
"""Assert that a testing update gets the right status."""
Expand Down
4 changes: 3 additions & 1 deletion bodhi-server/tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ def test_validate_acls_pagure_committers_exception(self, warning, mock_gpcfp, mo
assert len(mock_request.errors) == 0
mock_access.assert_called_once()
mock_gpcfp.assert_called_once()
warning.called_once_with('Unable to retrieve committers list from Pagure for bodhi.')
warning.assert_called_once_with(
'Unable to retrieve committers list from Pagure for bodhi.'
)

@mock.patch.dict('bodhi.server.validators.config', {'acl_system': 'dummy'})
def test_validate_acls_dummy(self):
Expand Down

0 comments on commit 62d6bd6

Please sign in to comment.