Coverage for functions \ flipdare \ generated \ shared \ model \ dare \ ballot_result.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-05-08 12:22 +1000

1#!/usr/bin/env python 

2# 

3# Copyright (c) 2026 Flipdare Pty Ltd. All rights reserved. 

4# 

5# This file is part of Flipdare's proprietary software and contains 

6# confidential and copyrighted material. Unauthorised copying, 

7# modification, distribution, or use of this file is strictly 

8# prohibited without prior written permission from Flipdare Pty Ltd. 

9# 

10# This software includes third-party components licensed under MIT, 

11# BSD, and Apache 2.0 licences. See THIRD_PARTY_NOTICES for details. 

12# 

13# NOTE: THIS FILE IS AUTO GENERATED. DO NOT EDIT. 

14# 

15# Generated by codegen_models.py 

16# 

17# Modify 'codegen_models.py' 

18# and re-run the script above to update. 

19# 

20 

21# pragma: no cover 

22from enum import StrEnum 

23 

24 

25class BallotResult(StrEnum): 

26 """Vote Status""" 

27 

28 ACCEPTED = "accepted" 

29 TIE = "tie" 

30 REJECTED = "rejected" 

31 AUTO_ACCEPTED = "auto_accepted" 

32 AUTO_REJECTED = "auto_rejected" 

33 NOT_ENOUGH_VOTES = "not_enough_votes" 

34 EXPIRED = "expired" 

35 

36 # ---- Convenience predicates ----------------------------------------- 

37 @property 

38 def is_accepted(self) -> bool: 

39 return self == BallotResult.ACCEPTED 

40 

41 @property 

42 def is_auto_accepted(self) -> bool: 

43 return self == BallotResult.AUTO_ACCEPTED 

44 

45 @property 

46 def is_rejected(self) -> bool: 

47 return self == BallotResult.REJECTED 

48 

49 @property 

50 def is_auto_rejected(self) -> bool: 

51 return self == BallotResult.AUTO_REJECTED 

52 

53 @property 

54 def is_tie(self) -> bool: 

55 return self == BallotResult.TIE 

56 

57 @property 

58 def is_expired(self) -> bool: 

59 return self == BallotResult.EXPIRED 

60 

61 @property 

62 def not_enough_votes(self) -> bool: 

63 return self == BallotResult.NOT_ENOUGH_VOTES 

64 

65 @property 

66 def is_finalized(self) -> bool: 

67 return self in { 

68 BallotResult.ACCEPTED, 

69 BallotResult.REJECTED, 

70 BallotResult.AUTO_ACCEPTED, 

71 BallotResult.AUTO_REJECTED, 

72 BallotResult.EXPIRED, 

73 }