• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / AccessControl / 4274890848

pending completion
4274890848

push

github

Jens Vagelpohl
- vb [ci skip]

934 of 1458 branches covered (64.06%)

Branch coverage included in aggregate %.

4982 of 5839 relevant lines covered (85.32%)

4.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.29
/src/AccessControl/unauthorized.py
1
##############################################################################
2
#
3
# Copyright (c) 2002 Zope Foundation and Contributors.
4
#
5
# This software is subject to the provisions of the Zope Public License,
6
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
7
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
8
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
9
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
10
# FOR A PARTICULAR PURPOSE
11
#
12
##############################################################################
13
"""Access control exceptions
5✔
14
"""
15

16
import zExceptions
5✔
17

18

19
class Unauthorized(zExceptions.Unauthorized):
5✔
20

21
    def getValueName(self):
5✔
22
        v = self.value
×
23
        n = getattr(v, 'getId', v)
×
24
        if n is v:
×
25
            n = getattr(v, 'id', v)
×
26
        if n is v:
×
27
            n = getattr(v, '__name__', v)
×
28
        if n is not v:
×
29
            if callable(n):
×
30
                try:
×
31
                    n = n()
×
32
                except TypeError:
×
33
                    pass
×
34
            return n
×
35

36
        c = getattr(v, '__class__', type(v))
×
37
        c = getattr(c, '__name__', 'object')
×
38
        return "a particular %s" % c
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc