From dae96feb81dba216c6481fbe8c4aee29d4c4687f Mon Sep 17 00:00:00 2001 From: Enrico Zini Date: Tue, 21 Apr 2020 22:46:21 +0200 Subject: [PATCH] Removed the last of textfixtures uses. refs: #5 --- .gitlab-ci.yml | 1 - dsa/tests/test_housekeeping.py | 17 ++++++++--------- test-instance/deploy.yml | 1 - 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a214d69..c7b8c85 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,6 @@ gnupg debian-keyring python3-git - python3-testfixtures libjs-bootstrap4 fonts-fork-awesome libjs-jquery-datatables diff --git a/dsa/tests/test_housekeeping.py b/dsa/tests/test_housekeeping.py index aefb5f0..407834a 100644 --- a/dsa/tests/test_housekeeping.py +++ b/dsa/tests/test_housekeeping.py @@ -7,7 +7,6 @@ import backend.const as const from process.models import Process from sitechecks.models import Inconsistency from unittest import mock -from testfixtures import LogCapture class MockHousekeeper: @@ -124,15 +123,15 @@ class TestCheckLDAPConsistency(ProcessFixtureMixin, TestCase): MockEntry("dd_u", supplementaryGid=["Debian"], cn="tcn", mn="tmn", sn="tsn", emailForward="test@example.org", accountStatus=None) ] - with LogCapture() as lc: + with self.assertLogs() as log: self.hk.run(CheckLDAPConsistency) - lc.check( - ("dsa.housekeeping", "INFO", "None: dd_u changing email_ldap from dd_u@example.org to test@example.org" - " (source: LDAP)"), - ('dsa.housekeeping', 'INFO', 'None: dd_u changing cn from Dd_u to tcn (source: LDAP)'), - ('dsa.housekeeping', 'INFO', 'None: dd_u changing mn from to tmn (source: LDAP)'), - ('dsa.housekeeping', 'INFO', 'None: dd_u changing sn from to tsn (source: LDAP)'), - ) + self.assertEqual(log.output, [ + "INFO:dsa.housekeeping:test.CheckLDAPConsistency: dd_u changing email_ldap from dd_u@example.org" + " to test@example.org (source: LDAP)", + 'INFO:dsa.housekeeping:test.CheckLDAPConsistency: dd_u changing cn from Dd_u to tcn (source: LDAP)', + 'INFO:dsa.housekeeping:test.CheckLDAPConsistency: dd_u changing mn from to tmn (source: LDAP)', + 'INFO:dsa.housekeeping:test.CheckLDAPConsistency: dd_u changing sn from to tsn (source: LDAP)', + ]) p = self.persons.dd_u p.refresh_from_db() diff --git a/test-instance/deploy.yml b/test-instance/deploy.yml index bef5f9a..74f5476 100644 --- a/test-instance/deploy.yml +++ b/test-instance/deploy.yml @@ -48,7 +48,6 @@ - gnupg - debian-keyring - python3-git - - python3-testfixtures - libjs-bootstrap4 - fonts-fork-awesome - libjs-jquery-datatables -- GitLab