From 449b7bf6e414ae8cea4c4ae30bb70eb986593912 Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 11 Jul 2018 23:25:08 -0500 Subject: [PATCH] reduce the amount of strict `not in` checks Signed-off-by: Adam Hill --- test/README.md | 1 - test/test_centos_fedora_support.py | 15 ++++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/test/README.md b/test/README.md index 07f6c539..5029becf 100644 --- a/test/README.md +++ b/test/README.md @@ -10,4 +10,3 @@ From command line all you need to do is: # How do I debug python? Highly recommended: Setup PyCharm on a **Docker enabled** machine. Having a python debugger like PyCharm changes your life if you've never used it :) - diff --git a/test/test_centos_fedora_support.py b/test/test_centos_fedora_support.py index 033d6752..1afde246 100644 --- a/test/test_centos_fedora_support.py +++ b/test/test_centos_fedora_support.py @@ -1,4 +1,5 @@ import pytest +import re from conftest import ( tick_box, info_box, @@ -18,14 +19,8 @@ def test_epel_and_remi_not_installed_fedora(Pihole): source /opt/pihole/basic-install.sh distro_check ''') - expected_stdout = info_box + (' Enabling EPEL package repository ' - '(https://fedoraproject.org/wiki/EPEL)') - assert expected_stdout not in distro_check.stdout - expected_stdout = tick_box + ' Installed epel-release' - assert expected_stdout not in distro_check.stdout - expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. ' - 'Deprecated PHP may be in use.') - assert expected_stdout not in distro_check.stdout + assert distro_check.stdout == '' + epel_package = Pihole.package('epel-release') assert not epel_package.is_installed remi_package = Pihole.package('remi-release') @@ -121,9 +116,7 @@ def test_php_upgrade_user_optin_centos(Pihole): source /opt/pihole/basic-install.sh distro_check ''') - expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. ' - 'Deprecated PHP may be in use.') - assert expected_stdout not in distro_check.stdout + assert 'opt-out' not in distro_check.stdout expected_stdout = info_box + (' Enabling Remi\'s RPM repository ' '(https://rpms.remirepo.net)') assert expected_stdout in distro_check.stdout