diff --git a/src/middlewared/middlewared/plugins/test/mock.py b/src/middlewared/middlewared/plugins/test/mock.py index ca97fc3c76487..67e5800af9552 100644 --- a/src/middlewared/middlewared/plugins/test/mock.py +++ b/src/middlewared/middlewared/plugins/test/mock.py @@ -1,6 +1,4 @@ -from middlewared.alert.base import ( - AlertCategory, AlertClass, AlertLevel, OneShotAlertClass, SimpleOneShotAlertClass -) +from middlewared.alert.base import AlertCategory, AlertClass, AlertLevel, SimpleOneShotAlertClass from middlewared.role import Role from middlewared.service import CallError, Service @@ -45,7 +43,6 @@ def method(*args, **kwargs): async def remove_mock(self, name, args): self.middleware.remove_mock(name, args) - async def set_mock_role(self): """ adds a MOCK role to role_manager and grants access to test.test1 and test.test2 @@ -63,7 +60,6 @@ async def set_mock_role(self): await self.middleware.call('alert.oneshot_create', 'SystemTesting') - # Dummy methods to mock for internal infrastructure testing (i.e. jobs manager) # When these are mocked over they will be available to users with the "MOCK" role. diff --git a/tests/api2/test_stig.py b/tests/api2/test_stig.py index cb66b1eee29f4..e2947470d9382 100644 --- a/tests/api2/test_stig.py +++ b/tests/api2/test_stig.py @@ -2,13 +2,12 @@ import pytest from middlewared.service_exception import CallError -from middlewared.service_exception import ValidationErrors as Verr -from middlewared.test.integration.assets.account import user +from middlewared.service_exception import ValidationErrors as Verr from middlewared.test.integration.assets.product import product_type, set_fips_available from middlewared.test.integration.assets.two_factor_auth import ( enabled_twofactor_auth, get_user_secret, get_2fa_totp_token ) -from middlewared.test.integration.utils import call, client, ssh +from middlewared.test.integration.utils import call, client from truenas_api_client import ValidationErrors @@ -109,7 +108,7 @@ def setup_stig(two_factor_full_admin): c.call('system.security.update', {'enable_fips': False, 'enable_gpos_stig': False}, job=True) -# The order of the following tests is significant. We gradully fixtures that have module scope +# The order of the following tests is significant. We gradually add fixtures that have module scope # as we finish checking for correct ValidationErrors def test_nonenterprise_fail(community_product): @@ -166,7 +165,7 @@ def test_stig_enabled_authenticator_assurance_level(setup_stig): def test_stig_roles_decrease(setup_stig): - # We need new webosocket connection to verify that privileges + # We need new websocket connection to verify that privileges # are appropriately decreased with client(auth=None) as c: do_stig_auth(c, setup_stig['user_obj'], setup_stig['secret']) @@ -183,7 +182,7 @@ def test_stig_roles_decrease(setup_stig): def test_stig_smb_auth_disabled(setup_stig): - # We need new webosocket connection to verify that privileges + # We need new websocket connection to verify that privileges # are appropriately decreased smb_user_cnt = setup_stig['connection'].call('user.query', [['smb', '=', True]], {'count': True}) diff --git a/tests/unit/test_role_manager.py b/tests/unit/test_role_manager.py index f2e46bb4e5e8c..36577b3cc5039 100644 --- a/tests/unit/test_role_manager.py +++ b/tests/unit/test_role_manager.py @@ -63,7 +63,7 @@ def test__roles_have_correct_stig_assignment(nostig_roles, role_name): ('FULL_ADMIN', '*', None, {'*'}), ('FULL_ADMIN', 'CALL', security.STIGType.GPOS, FULL_ADMIN_STIG), ]) -def test__roles_have_corect_allowlist(role_manager, role, method, enabled_stig_type, resources): +def test__roles_have_correct_allowlist(role_manager, role, method, enabled_stig_type, resources): allowlist = role_manager.allowlist_for_role(role, enabled_stig_type) allowlist_resources = set() for entry in allowlist: