Begin work on mocking CloudWatch Events.

This commit is contained in:
Justin Wiley 2016-11-29 17:19:26 -08:00
parent c3c6eaf281
commit d0a66f2dff
4 changed files with 133 additions and 0 deletions

5
moto/events/__init__.py Normal file
View File

@ -0,0 +1,5 @@
from __future__ import unicode_literals
from .models import events_backend
mock_events = events_backend.decorator

58
moto/events/models.py Normal file
View File

@ -0,0 +1,58 @@
from moto.core import BaseBackend
class EventsBackend(BaseBackend):
def __init__(self):
self.events = {}
self.rules = {}
def can_paginate(self):
pass
def delete_rule(self):
pass
def describe_rule(self, name):
event = self.events['name']
def disable_rule(self):
pass
def enable_rule(self):
pass
def generate_presigned_url(self):
pass
def get_paginator(self):
pass
def get_waiter(self):
pass
def list_rule_names_by_target(self):
pass
def list_rules(self):
pass
def list_targets_by_rule(self):
pass
def put_events(self):
pass
def put_rule(self, name, **kwargs):
pass
def put_targets(self):
pass
def remove_targets(self):
pass
def test_event_pattern(self):
pass
events_backend = EventsBackend()

59
moto/events/responses.py Normal file
View File

@ -0,0 +1,59 @@
import json
from moto.core.responses import BaseResponse
class EventsHandler(BaseResponse):
def error(self, type_, status=400):
return status, self.response_headers, json.dumps({'__type': type_})
def can_paginate(self):
pass
def delete_rule(self):
pass
def describe_rule(self):
pass
def disable_rule(self):
pass
def enable_rule(self):
pass
def generate_presigned_url(self):
pass
def get_paginator(self):
pass
def get_waiter(self):
pass
def list_rule_names_by_target(self):
pass
def list_rules(self):
pass
def list_targets_by_rule(self):
pass
def put_events(self):
pass
def put_rule(self):
if 'Name' not in self.body:
return self.error("com.amazonaws.events.validate#ValidationException")
pass
def put_targets(self):
pass
def remove_targets(self):
pass
def test_event_pattern(self):
pass

11
moto/events/urls.py Normal file
View File

@ -0,0 +1,11 @@
from __future__ import unicode_literals
from .responses import EventsHandler
url_bases = [
"https?://events.(.+).amazonaws.com"
]
url_paths = {
"{0}/": EventsHandler.dispatch,
}