Coverage for circuits/choices.py: 100%

33 statements  

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

1from django.utils.translation import gettext_lazy as _ 

2 

3from utilities.choices import Choice, ChoiceSet 

4 

5# 

6# Circuits 

7# 

8 

9 

10class CircuitStatusChoices(ChoiceSet): 

11 key = 'Circuit.status' 

12 

13 STATUS_DEPROVISIONING = 'deprovisioning' 

14 STATUS_ACTIVE = 'active' 

15 STATUS_PLANNED = 'planned' 

16 STATUS_PROVISIONING = 'provisioning' 

17 STATUS_OFFLINE = 'offline' 

18 STATUS_DECOMMISSIONED = 'decommissioned' 

19 

20 CHOICES = [ 

21 Choice( 

22 STATUS_PLANNED, _('Planned'), color='cyan', 

23 description=_('Designated for future use but not yet installed') 

24 ), 

25 Choice(STATUS_PROVISIONING, _('Provisioning'), color='blue', description=_('Being configured for service')), 

26 Choice(STATUS_ACTIVE, _('Active'), color='green', description=_('Fully operational and in service')), 

27 Choice(STATUS_OFFLINE, _('Offline'), color='red', description=_('Installed but not currently in service')), 

28 Choice(STATUS_DEPROVISIONING, _('Deprovisioning'), color='yellow', description=_('Being removed from service')), 

29 Choice( 

30 STATUS_DECOMMISSIONED, _('Decommissioned'), color='gray', 

31 description=_('Retired and no longer in service') 

32 ), 

33 ] 

34 

35 

36class CircuitCommitRateChoices(ChoiceSet): 

37 key = 'Circuit.commit_rate' 

38 

39 CHOICES = [ 

40 Choice(10000, '10 Mbps'), 

41 Choice(100000, '100 Mbps'), 

42 Choice(1000000, '1 Gbps'), 

43 Choice(10000000, '10 Gbps'), 

44 Choice(25000000, '25 Gbps'), 

45 Choice(40000000, '40 Gbps'), 

46 Choice(100000000, '100 Gbps'), 

47 Choice(200000000, '200 Gbps'), 

48 Choice(400000000, '400 Gbps'), 

49 Choice(1544, 'T1 (1.544 Mbps)'), 

50 Choice(2048, 'E1 (2.048 Mbps)'), 

51 ] 

52 

53 

54# 

55# CircuitTerminations 

56# 

57 

58class CircuitTerminationSideChoices(ChoiceSet): 

59 

60 SIDE_A = 'A' 

61 SIDE_Z = 'Z' 

62 

63 CHOICES = ( 

64 Choice(SIDE_A, 'A'), 

65 Choice(SIDE_Z, 'Z') 

66 ) 

67 

68 

69class CircuitTerminationPortSpeedChoices(ChoiceSet): 

70 key = 'CircuitTermination.port_speed' 

71 

72 CHOICES = [ 

73 Choice(10000, '10 Mbps'), 

74 Choice(100000, '100 Mbps'), 

75 Choice(1000000, '1 Gbps'), 

76 Choice(10000000, '10 Gbps'), 

77 Choice(25000000, '25 Gbps'), 

78 Choice(40000000, '40 Gbps'), 

79 Choice(100000000, '100 Gbps'), 

80 Choice(200000000, '200 Gbps'), 

81 Choice(400000000, '400 Gbps'), 

82 Choice(1544, 'T1 (1.544 Mbps)'), 

83 Choice(2048, 'E1 (2.048 Mbps)'), 

84 ] 

85 

86 

87class CircuitPriorityChoices(ChoiceSet): 

88 key = 'CircuitGroupAssignment.priority' 

89 

90 PRIORITY_PRIMARY = 'primary' 

91 PRIORITY_SECONDARY = 'secondary' 

92 PRIORITY_TERTIARY = 'tertiary' 

93 PRIORITY_INACTIVE = 'inactive' 

94 

95 CHOICES = [ 

96 Choice(PRIORITY_PRIMARY, _('Primary')), 

97 Choice(PRIORITY_SECONDARY, _('Secondary')), 

98 Choice(PRIORITY_TERTIARY, _('Tertiary')), 

99 Choice(PRIORITY_INACTIVE, _('Inactive')), 

100 ] 

101 

102 

103# 

104# Virtual circuits 

105# 

106 

107class VirtualCircuitTerminationRoleChoices(ChoiceSet): 

108 ROLE_PEER = 'peer' 

109 ROLE_HUB = 'hub' 

110 ROLE_SPOKE = 'spoke' 

111 

112 CHOICES = [ 

113 Choice(ROLE_PEER, _('Peer'), color='green', description=_('Connects to other peers as an equal endpoint')), 

114 Choice(ROLE_HUB, _('Hub'), color='blue', description=_('Central endpoint to which spokes connect')), 

115 Choice(ROLE_SPOKE, _('Spoke'), color='orange', description=_('Remote endpoint connecting to a hub')), 

116 ]