Exemple #1
0
    def test_when_validating_dissociation_then_calls_common_and_dissociation_validators(
        self, ):
        common = Mock(Validator)
        dissociation = Mock(Validator)
        model = Mock()

        validator = ValidationAssociation(common=[common],
                                          dissociation=[dissociation])

        validator.validate_dissociation(model)

        common.validate.assert_called_once_with(model)
        dissociation.validate.assert_called_once_with(model)
Exemple #2
0
def build_validator():
    return ValidationAssociation(association=[
        ValidateLineDeviceAssociation(),
        ValidateLinePosition(line_dao_module),
        ValidateRequiredResources(user_line_dao_module,
                                  line_extension_dao_module),
        ValidateMultipleLines(line_dao_module),
    ])
Exemple #3
0
def build_validator_custom():
    return ValidationAssociation(
        association=[
            ValidateLineCustomAssociation(line_dao_module, trunk_dao_module)
        ],
        dissociation=[
            ValidateLineDissociation(user_line_dao_module,
                                     line_extension_dao_module)
        ],
    )
Exemple #4
0
def build_validator(endpoint):
    return ValidationAssociation(
        association=[
            ValidateLineAssociation(endpoint, line_dao_module,
                                    trunk_dao_module)
        ],
        dissociation=[
            ValidateLineDissociation(user_line_dao_module,
                                     line_extension_dao_module)
        ],
    )
Exemple #5
0
    def test_when_validating_multiple_models_then_all_models_passed_to_validator(
            self):
        common = Mock(Validator)
        association = Mock(Validator)
        dissociation = Mock(Validator)
        model1 = Mock()
        model2 = Mock()

        validator = ValidationAssociation(common=[common],
                                          association=[association],
                                          dissociation=[dissociation])

        validator.validate_association(model1, model2)
        validator.validate_dissociation(model1, model2)

        common.validate.assert_called_with(model1, model2)
        association.validate.assert_called_once_with(model1, model2)
        dissociation.validate.assert_called_once_with(model1, model2)
def build_validator_iax():
    return ValidationAssociation(association=[TrunkRegisterIAXAssociationValidator()])
def build_validator():
    return ValidationAssociation(
        association=[QueueExtensionAssociationValidator(context_dao_module)])
def build_validator():
    return ValidationAssociation(
        association=[OutcallExtensionAssociationValidator()])
def build_validator_interceptor_user():
    return ValidationAssociation(association=[CallPickupUserValidator()])
Exemple #10
0
def build_validator_interceptor_group():
    return ValidationAssociation(association=[CallPickupGroupValidator()])
Exemple #11
0
def build_validator():
    return ValidationAssociation(association=[UserAgentAssociationValidator()])
Exemple #12
0
def build_validator():
    return ValidationAssociation(
        association=[ContextContextAssociationValidator()])
Exemple #13
0
def build_validator_member_extension():
    return ValidationAssociation(
        association=[GroupMemberExtensionAssociationValidator()])
Exemple #14
0
def build_validator_member_user():
    return ValidationAssociation(
        association=[GroupMemberUserAssociationValidator()])
Exemple #15
0
def build_validator():
    return ValidationAssociation(
        association=[AgentSkillAssociationValidator()])
Exemple #16
0
def build_user_template_validator():
    return ValidationAssociation(association=[
        AssociatePrivateTemplateValidator(),
        AssociateSameTenant()
    ], )
Exemple #17
0
def build_validator():
    return ValidationAssociation(
        association=[LineExtensionAssociationValidator(context_dao_module)],
        dissociation=[LineExtensionDissociationValidator()],
    )
Exemple #18
0
def build_validator():
    return ValidationAssociation(association=[SwitchboardMemberUserValidator()])
Exemple #19
0
def build_validator_target_group():
    return ValidationAssociation(association=[CallPickupGroupValidator()])
Exemple #20
0
def build_validator():
    return ValidationAssociation(association=[UserHasNoVoicemail()])
Exemple #21
0
def build_validator_target_user():
    return ValidationAssociation(association=[CallPickupUserValidator()])
Exemple #22
0
def build_validator_sip():
    return ValidationAssociation(
        association=[TrunkRegisterSIPAssociationValidator()])
Exemple #23
0
def build_validator():
    return ValidationAssociation(association=[AssociateUserCallPermission()])
Exemple #24
0
def build_validator():
    return ValidationAssociation(
        association=[OutcallScheduleAssociationValidator()])
Exemple #25
0
def build_validator():
    return ValidationAssociation(
        association=[UserLineAssociationValidator()],
        dissociation=[UserLineDissociationValidator()],
    )
Exemple #26
0
def build_validator():
    return ValidationAssociation(
        association=[UserScheduleAssociationValidator()])
Exemple #27
0
def build_validator():
    return ValidationAssociation(
        association=[GroupTrunkAssociationValidator()])
Exemple #28
0
def build_validator_recipient_user():
    return ValidationAssociation(
        association=[CallFilterRecipientUserAssociationValidator()])
Exemple #29
0
def build_validator():
    return ValidationAssociation(association=[UserGroupAssociationValidator()])
Exemple #30
0
def build_validator_surrogate_user():
    return ValidationAssociation(
        association=[CallFilterSurrogateUserAssociationValidator()])