From 3277ca777821e76955fb26d80788939a311db9db Mon Sep 17 00:00:00 2001 From: halcy Date: Mon, 7 Nov 2022 23:11:30 +0200 Subject: Initial test fixing pass. Four tests still fail. --- tests/test_admin.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'tests/test_admin.py') diff --git a/tests/test_admin.py b/tests/test_admin.py index 4138783..c9df29a 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -1,4 +1,5 @@ import pytest +import time @pytest.mark.vcr() def test_admin_accounts(api2): @@ -18,31 +19,47 @@ def test_admin_moderation(api, api2): account_initial = api.account_verify_credentials() account = account_initial - try: + try: + print("A") api2.admin_account_moderate(account, "disable") account = api2.admin_account(account_initial) assert(account.disabled) + print("B") account = api2.admin_account_enable(account) assert(not account.disabled) + print("C") api2.admin_account_moderate(account, "silence") account = api2.admin_account(account_initial) assert(account.silenced) + print("D") account = api2.admin_account_unsilence(account) assert(not account.silenced) + print("E") api2.admin_account_moderate(account, "suspend") account = api2.admin_account(account_initial) assert(account.suspended) + print("F") account = api2.admin_account_unsuspend(account) assert(not account.suspended) finally: - api2.admin_account_unsuspend(account) - api2.admin_account_enable(account) - api2.admin_account_unsilence(account) + try: + api2.admin_account_unsuspend(account) + except: + pass + try: + api2.admin_account_enable(account) + except: + pass + try: + api2.admin_account_unsilence(account) + except: + pass + time.sleep(4) @pytest.mark.vcr() def test_admin_reports(api, api2, status): -- cgit v1.2.3