From 0f53f0c3bf548b8271a1cedc6db27d64682d47a4 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: May 14 2018 15:30:05 +0000 Subject: Fix tests. We had one test that still referred to `test_case_name` which doesn't exist for one of our rules: the remote rule. This was failing in the `%check` section of our rpm build in the Jenkins pipeline. --- diff --git a/greenwave/tests/test_policies.py b/greenwave/tests/test_policies.py index 8fc56ab..282f5f8 100644 --- a/greenwave/tests/test_policies.py +++ b/greenwave/tests/test_policies.py @@ -163,10 +163,10 @@ def test_load_policies(): app = create_app('greenwave.config.TestingConfig') assert len(app.config['policies']) > 0 assert any(policy.id == '1' for policy in app.config['policies']) - assert any(policy.decision_context == 'errata_newfile_to_qe' for policy in - app.config['policies']) - assert any(rule.test_case_name == 'dist.rpmdiff.analysis.abi_symbols' for policy in - app.config['policies'] for rule in policy.rules) + assert any(policy.decision_context == 'errata_newfile_to_qe' + for policy in app.config['policies']) + assert any(getattr(rule, 'test_case_name', None) == 'dist.rpmdiff.analysis.abi_symbols' + for policy in app.config['policies'] for rule in policy.rules) def test_invalid_payload():