def test_check_healthy_marathon_tasks_for_service_instance(mock_healthy_instances, mock_send_event_if_under_replication): service = 'service' instance = 'instance' cluster = 'cluster' soa_dir = 'soa_dir' client = mock.Mock() mock_healthy_instances.return_value = 2 check_marathon_services_replication.check_healthy_marathon_tasks_for_service_instance( client=client, service=service, instance=instance, cluster=cluster, soa_dir=soa_dir, crit_threshold=50, expected_count=10 ) assert mock_send_event_if_under_replication.called_once_with( service=service, instance=instance, cluster=cluster, crit_threshold=50, expected_count=10, num_available=2, soa_dir=soa_dir )
def test_check_healthy_marathon_tasks_for_service_instance(mock_healthy_instances, mock_send_event_if_under_replication): service = 'service' instance = 'instance' cluster = 'cluster' soa_dir = 'soa_dir' client = mock.Mock() mock_healthy_instances.return_value = 2 check_marathon_services_replication.check_healthy_marathon_tasks_for_service_instance( client=client, service=service, instance=instance, cluster=cluster, soa_dir=soa_dir, crit_threshold=50, expected_count=10 ) assert mock_send_event_if_under_replication.called_once_with( service=service, instance=instance, cluster=cluster, crit_threshold=50, expected_count=10, num_available=2, soa_dir=soa_dir )
def test_check_healthy_marathon_tasks_for_service_instance( mock_healthy_instances, mock_send_event_if_under_replication, ): service = 'service' instance = 'instance' cluster = 'cluster' soa_dir = 'soa_dir' mock_healthy_instances.return_value = 2 check_marathon_services_replication.check_healthy_marathon_tasks_for_service_instance( service=service, instance=instance, cluster=cluster, soa_dir=soa_dir, expected_count=10, all_tasks=mock.Mock(), ) mock_send_event_if_under_replication.assert_called_once_with( service=service, instance=instance, cluster=cluster, expected_count=10, num_available=2, soa_dir=soa_dir, )
def test_check_healthy_marathon_tasks_for_service_instance( mock_healthy_instances, mock_send_replication_event_if_under_replication, instance_config, ): mock_healthy_instances.return_value = 2 check_marathon_services_replication.check_healthy_marathon_tasks_for_service_instance( instance_config=instance_config, expected_count=10, all_tasks=mock.Mock() ) mock_send_replication_event_if_under_replication.assert_called_once_with( instance_config=instance_config, expected_count=10, num_available=2 )
def test_check_healthy_marathon_tasks_for_service_instance( mock_healthy_instances, mock_send_event_if_under_replication ): service = "service" instance = "instance" cluster = "cluster" soa_dir = "soa_dir" client = mock.Mock() mock_healthy_instances.return_value = 2 check_marathon_services_replication.check_healthy_marathon_tasks_for_service_instance( client=client, service=service, instance=instance, cluster=cluster, soa_dir=soa_dir, expected_count=10 ) mock_send_event_if_under_replication.assert_called_once_with( service=service, instance=instance, cluster=cluster, expected_count=10, num_available=2, soa_dir=soa_dir )