From 9d648a751733570d4fe4b5dd3925cd240342caac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Gajdu=C5=A1ek?= Date: Tue, 30 Apr 2024 13:38:31 +0200 Subject: [PATCH] Address review comments --- tests/foreman/api/test_errata.py | 4 ++-- tests/foreman/api/test_notifications.py | 4 ++-- tests/foreman/ui/test_ansible.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/foreman/api/test_errata.py b/tests/foreman/api/test_errata.py index 0751dc5bdce..8fd717b44fd 100644 --- a/tests/foreman/api/test_errata.py +++ b/tests/foreman/api/test_errata.py @@ -123,7 +123,7 @@ def _validate_errata_counts(host, errata_type, expected_value, timeout=120): sleep(5) else: pytest.fail( - 'Host {} contains {} {} errata, but expected to contain ' '{} of them'.format( + 'Host {} contains {} {} errata, but expected to contain {} of them'.format( host.name, host.content_facet_attributes['errata_counts'][errata_type], errata_type, @@ -149,7 +149,7 @@ def _fetch_available_errata(host, expected_amount=None, timeout=120): errata = host.errata() else: pytest.fail( - 'Host {} contains {} available errata, but expected to ' 'contain {} of them'.format( + 'Host {} contains {} available errata, but expected to contain {} of them'.format( host.name, len(errata['results']), expected_amount if not None else 'No expected_amount provided', diff --git a/tests/foreman/api/test_notifications.py b/tests/foreman/api/test_notifications.py index ebb1e1771ef..13b142d9c53 100644 --- a/tests/foreman/api/test_notifications.py +++ b/tests/foreman/api/test_notifications.py @@ -239,8 +239,8 @@ def long_running_task(target_sat): f"SET start_at = {sql_date_2_days_ago}, " f" started_at = {sql_date_2_days_ago}, " f" state_updated_at = {sql_date_2_days_ago} " - f"WHERE id='{job['task']['id']}';\nEOF\n\" " - ) + f"WHERE id=\'{job['task']['id']}\';\nEOF\n\" " + ) # fmt: skip # skip formatting to avoid breaking the SQL query assert 'UPDATE 1' in result.stdout, f'Failed to age task {job["task"]["id"]}: {result.stderr}' yield job diff --git a/tests/foreman/ui/test_ansible.py b/tests/foreman/ui/test_ansible.py index 23edf4f2d96..4a9b4162563 100644 --- a/tests/foreman/ui/test_ansible.py +++ b/tests/foreman/ui/test_ansible.py @@ -183,7 +183,7 @@ def _finalize(): result = rhel_contenthost.execute(command) assert result.status == 0, f'Failed to register host: {result.stderr}' target_host = rhel_contenthost.nailgun_host - default_value = '["test"]' + default_value = '[\"test\"]' # fmt: skip parameter_type = 'array' with target_sat.ui_session() as session: session.organization.select(org_name=module_org.name)