Change put_rule (and it's response) and fix tests_events/
This commit is contained in:
parent
7318523b50
commit
a1f664d2bb
3 changed files with 22 additions and 9 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue