Coverage for app/venv/lib/python3.14/site-packages/weblate/auth/results.py: 93%

15 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 07:15 +0000

1# Copyright © Michal Čihař <michal@weblate.org> 

2# 

3# SPDX-License-Identifier: GPL-3.0-or-later 

4 

5from __future__ import annotations 

6 

7 

8class PermissionResult: 

9 def __init__(self, reason: str = "") -> None: 

10 self._reason: str = reason 

11 

12 @property 

13 def reason(self) -> str: 

14 return self._reason 

15 

16 def __bool__(self) -> bool: 

17 raise NotImplementedError 

18 

19 

20class Allowed(PermissionResult): 

21 def __bool__(self) -> bool: 

22 return True 

23 

24 

25class Denied(PermissionResult): 

26 def __bool__(self) -> bool: 

27 return False