Skip to content

Commit

Permalink
Remove unused classes from .tests.testBindings:
Browse files Browse the repository at this point in the history
* `SecurityManager`
* `RivilegedUser`
  • Loading branch information
Michael Howitz committed Jul 13, 2022
1 parent 5fc7879 commit 2a97c98
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ with-windows = false
with-future-python = false

[coverage]
fail-under = 75
fail-under = 83

[manifest]
additional-rules = [
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Changelog

- Add support for Python 3.10.

- Remove unused classes ``SecurityManager`` and ``RivilegedUser`` from
``.tests.testBindings``.

4.13 (2021-07-02)
-----------------

Expand Down
42 changes: 0 additions & 42 deletions src/Products/PythonScripts/tests/testBindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,6 @@
from OFS.ObjectManager import ObjectManager


class SecurityManager(object):

def __init__(self, reject=0):
self.calls = []
self.reject = reject

def validate(self, *args):
from AccessControl import Unauthorized
self.calls.append(('validate', args))
if self.reject:
raise Unauthorized
return 1

def validateValue(self, *args):
from AccessControl import Unauthorized
self.calls.append(('validateValue', args))
if self.reject:
raise Unauthorized
return 1

def checkPermission(self, *args):
self.calls.append(('checkPermission', args))
return not self.reject

def addContext(self, *args):
self.calls.append(('addContext', args))
return 1

def removeContext(self, *args):
self.calls.append(('removeContext', args))
return 1


class UnderprivilegedUser(object):

def getId(self):
Expand All @@ -63,15 +30,6 @@ def allowed(self, object, object_roles=None):
return 0


class RivilegedUser(object):

def getId(self):
return 'privileged'

def allowed(self, object, object_roles=None):
return 1


class FauxRoot(ObjectManager):

def getPhysicalPath(self):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ commands =
mkdir -p {toxinidir}/parts/htmlcov
coverage run {envbindir}/test {posargs:-cv}
coverage html
coverage report -m --fail-under=75
coverage report -m --fail-under=83

[coverage:run]
branch = True
Expand Down

0 comments on commit 2a97c98

Please sign in to comment.