def setUp(self): from AccessControl import ModuleSecurityInfo as MSI from AccessControl.SecurityInfo import _moduleSecurity from AccessControl.SecurityInfo import _appliedModuleSecurity self._ms_before = _moduleSecurity.copy() self._ams_before = _appliedModuleSecurity.copy() MSI('string').declarePublic('split') MSI('sets').declarePublic('Set') newSecurityManager(None, None)
def test_failed_import_keeps_MSI(self): # LP #281156 from AccessControl import ModuleSecurityInfo as MSI from AccessControl.SecurityInfo import _moduleSecurity as MS from AccessControl.ZopeGuards import guarded_import MSI('AccessControl.tests.nonesuch').declarePublic('pub') self.failUnless('AccessControl.tests.nonesuch' in MS) self.assertRaises(ImportError, guarded_import, 'AccessControl.tests.nonesuch', ()) self.failUnless('AccessControl.tests.nonesuch' in MS)
def setUp(self): from AccessControl import ModuleSecurityInfo as MSI MSI('AccessControl.tests.mixed_module').declarePublic('pub') MSI('AccessControl.tests.public_module').declarePublic('pub') MSI('AccessControl.tests.public_module.submodule').declarePublic('pub')
def setUp(self): from AccessControl import ModuleSecurityInfo as MSI mod = 'AccessControl.tests' MSI('%s.mixed_module' % mod).declarePublic('pub') # NOQA: D001 MSI('%s.public_module' % mod).declarePublic('pub') # NOQA: D001 MSI('%s.public_module.submodule' % mod).declarePublic('pub') # NOQA