Esempio n. 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)
Esempio n. 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),
    ])
Esempio n. 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)
        ],
    )
Esempio n. 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)
        ],
    )
Esempio n. 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)
Esempio n. 6
0
def build_validator_iax():
    return ValidationAssociation(association=[TrunkRegisterIAXAssociationValidator()])
Esempio n. 7
0
def build_validator():
    return ValidationAssociation(
        association=[QueueExtensionAssociationValidator(context_dao_module)])
Esempio n. 8
0
def build_validator():
    return ValidationAssociation(
        association=[OutcallExtensionAssociationValidator()])
Esempio n. 9
0
def build_validator_interceptor_user():
    return ValidationAssociation(association=[CallPickupUserValidator()])
Esempio n. 10
0
def build_validator_interceptor_group():
    return ValidationAssociation(association=[CallPickupGroupValidator()])
Esempio n. 11
0
def build_validator():
    return ValidationAssociation(association=[UserAgentAssociationValidator()])
Esempio n. 12
0
def build_validator():
    return ValidationAssociation(
        association=[ContextContextAssociationValidator()])
Esempio n. 13
0
def build_validator_member_extension():
    return ValidationAssociation(
        association=[GroupMemberExtensionAssociationValidator()])
Esempio n. 14
0
def build_validator_member_user():
    return ValidationAssociation(
        association=[GroupMemberUserAssociationValidator()])
Esempio n. 15
0
def build_validator():
    return ValidationAssociation(
        association=[AgentSkillAssociationValidator()])
Esempio n. 16
0
def build_user_template_validator():
    return ValidationAssociation(association=[
        AssociatePrivateTemplateValidator(),
        AssociateSameTenant()
    ], )
Esempio n. 17
0
def build_validator():
    return ValidationAssociation(
        association=[LineExtensionAssociationValidator(context_dao_module)],
        dissociation=[LineExtensionDissociationValidator()],
    )
Esempio n. 18
0
def build_validator():
    return ValidationAssociation(association=[SwitchboardMemberUserValidator()])
Esempio n. 19
0
def build_validator_target_group():
    return ValidationAssociation(association=[CallPickupGroupValidator()])
Esempio n. 20
0
def build_validator():
    return ValidationAssociation(association=[UserHasNoVoicemail()])
Esempio n. 21
0
def build_validator_target_user():
    return ValidationAssociation(association=[CallPickupUserValidator()])
Esempio n. 22
0
def build_validator_sip():
    return ValidationAssociation(
        association=[TrunkRegisterSIPAssociationValidator()])
Esempio n. 23
0
def build_validator():
    return ValidationAssociation(association=[AssociateUserCallPermission()])
Esempio n. 24
0
def build_validator():
    return ValidationAssociation(
        association=[OutcallScheduleAssociationValidator()])
Esempio n. 25
0
def build_validator():
    return ValidationAssociation(
        association=[UserLineAssociationValidator()],
        dissociation=[UserLineDissociationValidator()],
    )
Esempio n. 26
0
def build_validator():
    return ValidationAssociation(
        association=[UserScheduleAssociationValidator()])
Esempio n. 27
0
def build_validator():
    return ValidationAssociation(
        association=[GroupTrunkAssociationValidator()])
Esempio n. 28
0
def build_validator_recipient_user():
    return ValidationAssociation(
        association=[CallFilterRecipientUserAssociationValidator()])
Esempio n. 29
0
def build_validator():
    return ValidationAssociation(association=[UserGroupAssociationValidator()])
Esempio n. 30
0
def build_validator_surrogate_user():
    return ValidationAssociation(
        association=[CallFilterSurrogateUserAssociationValidator()])