102 lines
3 KiB
Python
102 lines
3 KiB
Python
from infrasynth.shared.enums import (
|
|
ApprovalStrategy,
|
|
AuditAction,
|
|
BillingInterval,
|
|
ChannelType,
|
|
EventSeverity,
|
|
InvoiceStatus,
|
|
SubscriptionStatus,
|
|
)
|
|
|
|
|
|
class TestChannelType:
|
|
def test_values(self):
|
|
assert ChannelType.EMAIL == "email"
|
|
assert ChannelType.SMS == "sms"
|
|
assert ChannelType.WHATSAPP == "whatsapp"
|
|
assert ChannelType.TELEGRAM == "telegram"
|
|
assert ChannelType.PUSH == "push"
|
|
|
|
def test_choices(self):
|
|
choices = ChannelType.choices()
|
|
assert isinstance(choices, list)
|
|
assert ("email", "Email") in choices
|
|
assert ("sms", "Sms") in choices
|
|
assert len(choices) == 5
|
|
|
|
|
|
class TestEventSeverity:
|
|
def test_values(self):
|
|
assert EventSeverity.INFO == "info"
|
|
assert EventSeverity.WARNING == "warning"
|
|
assert EventSeverity.ERROR == "error"
|
|
assert EventSeverity.CRITICAL == "critical"
|
|
|
|
def test_choices(self):
|
|
choices = EventSeverity.choices()
|
|
assert len(choices) == 4
|
|
assert ("critical", "Critical") in choices
|
|
|
|
|
|
class TestBillingInterval:
|
|
def test_values(self):
|
|
assert BillingInterval.MONTHLY == "monthly"
|
|
assert BillingInterval.YEARLY == "yearly"
|
|
|
|
def test_choices(self):
|
|
choices = BillingInterval.choices()
|
|
assert len(choices) == 2
|
|
assert ("monthly", "Monthly") in choices
|
|
|
|
|
|
class TestAuditAction:
|
|
def test_values(self):
|
|
assert AuditAction.CREATE == "create"
|
|
assert AuditAction.UPDATE == "update"
|
|
assert AuditAction.DELETE == "delete"
|
|
|
|
def test_choices(self):
|
|
choices = AuditAction.choices()
|
|
assert len(choices) == 3
|
|
assert ("create", "Create") in choices
|
|
|
|
|
|
class TestSubscriptionStatus:
|
|
def test_values(self):
|
|
assert SubscriptionStatus.ACTIVE == "active"
|
|
assert SubscriptionStatus.PAST_DUE == "past_due"
|
|
assert SubscriptionStatus.CANCELLED == "cancelled"
|
|
assert SubscriptionStatus.EXPIRED == "expired"
|
|
assert SubscriptionStatus.TRIALING == "trialing"
|
|
|
|
def test_choices(self):
|
|
choices = SubscriptionStatus.choices()
|
|
assert len(choices) == 5
|
|
assert ("active", "Active") in choices
|
|
assert ("past_due", "Past Due") in choices
|
|
|
|
|
|
class TestInvoiceStatus:
|
|
def test_values(self):
|
|
assert InvoiceStatus.DRAFT == "draft"
|
|
assert InvoiceStatus.OPEN == "open"
|
|
assert InvoiceStatus.PAID == "paid"
|
|
assert InvoiceStatus.VOID == "void"
|
|
assert InvoiceStatus.UNCOLLECTIBLE == "uncollectible"
|
|
|
|
def test_choices(self):
|
|
choices = InvoiceStatus.choices()
|
|
assert len(choices) == 5
|
|
assert ("uncollectible", "Uncollectible") in choices
|
|
|
|
|
|
class TestApprovalStrategy:
|
|
def test_values(self):
|
|
assert ApprovalStrategy.ANY == "any"
|
|
assert ApprovalStrategy.ALL == "all"
|
|
assert ApprovalStrategy.MAJORITY == "majority"
|
|
|
|
def test_choices(self):
|
|
choices = ApprovalStrategy.choices()
|
|
assert len(choices) == 3
|
|
assert ("majority", "Majority") in choices
|