Change put_rule (and it's response) and fix tests_events/

This commit is contained in:
Guilherme Martins Crocetti 2020-03-22 17:32:37 -03:00
commit a1f664d2bb
3 changed files with 22 additions and 9 deletions

View file

@ -1,15 +1,16 @@
from moto.events.models import EventsBackend
from moto.events import mock_events
import json
import random
import unittest
import boto3
import sure # noqa
from botocore.exceptions import ClientError
from moto.core.exceptions import JsonRESTError
from nose.tools import assert_raises
from moto.core import ACCOUNT_ID
from moto.core.exceptions import JsonRESTError
from moto.events import mock_events
from moto.events.models import EventsBackend
RULES = [
{"Name": "test1", "ScheduleExpression": "rate(5 minutes)"},
@ -75,6 +76,18 @@ def generate_environment():
return client
@mock_events
def test_put_rule():
client = boto3.client("events", "us-west-2")
client.list_rules()["Rules"].should.have.length_of(0)
rule_data = get_random_rule()
client.put_rule(**rule_data)
client.list_rules()["Rules"].should.have.length_of(1)
@mock_events
def test_list_rules():
client = generate_environment()