def test_ecs_server_get_warnings(): since = datetime.now() - timedelta(hours=1) until = datetime.now() + timedelta(hours=1) event_unable = { u'createdAt': datetime.now(), u'message': u'unable to foo', } event_unknown = { u'createdAt': datetime.now(), u'message': u'unkown foo', } service = EcsService('foo', { u'deployments': [], u'events': [event_unable, event_unknown], }) assert len(service.get_warnings(since, until)) == 1
def service_without_deployments(): return EcsService(CLUSTER_NAME, deepcopy(PAYLOAD_SERVICE_WITHOUT_DEPLOYMENTS))
def service(): return EcsService(CLUSTER_NAME, deepcopy(PAYLOAD_SERVICE))
def service_with_errors(): return EcsService(CLUSTER_NAME, deepcopy(PAYLOAD_SERVICE_WITH_ERRORS))
def service_with_strategy(): return EcsService(CLUSTER_NAME, deepcopy(PAYLOAD_SERVICE_WITH_STRATEGY))