events: rename event_type to events_types as it's multiple
This commit is contained in:
parent
b6bf036756
commit
9f25d52d44
2 changed files with 8 additions and 8 deletions
|
|
@ -25,7 +25,7 @@ class EventCatcher(object):
|
|||
|
||||
def __init__(self):
|
||||
self.events = [] # the actual events captured
|
||||
self.event_types = [] # the types of events captured
|
||||
self.events_types = [] # the types of events captured
|
||||
|
||||
def __enter__(self):
|
||||
self.event_trigger_patch = mock.patch('rhodecode.events.trigger')
|
||||
|
|
@ -38,4 +38,4 @@ class EventCatcher(object):
|
|||
for call in self.mocked_event_trigger.call_args_list:
|
||||
event = call[0][0]
|
||||
self.events.append(event)
|
||||
self.event_types.append(type(event))
|
||||
self.events_types.append(type(event))
|
||||
|
|
|
|||
|
|
@ -52,28 +52,28 @@ def scm_extras(user_regular, repo_stub):
|
|||
def test_create_delete_repo_fires_events(backend):
|
||||
with EventCatcher() as event_catcher:
|
||||
repo = backend.create_repo()
|
||||
assert event_catcher.event_types == [RepoPreCreateEvent, RepoCreatedEvent]
|
||||
assert event_catcher.events_types == [RepoPreCreateEvent, RepoCreatedEvent]
|
||||
|
||||
with EventCatcher() as event_catcher:
|
||||
RepoModel().delete(repo)
|
||||
assert event_catcher.event_types == [RepoPreDeleteEvent, RepoDeletedEvent]
|
||||
assert event_catcher.events_types == [RepoPreDeleteEvent, RepoDeletedEvent]
|
||||
|
||||
|
||||
def test_pull_fires_events(scm_extras):
|
||||
with EventCatcher() as event_catcher:
|
||||
hooks_base.pre_push(scm_extras)
|
||||
assert event_catcher.event_types == [RepoPrePushEvent]
|
||||
assert event_catcher.events_types == [RepoPrePushEvent]
|
||||
|
||||
with EventCatcher() as event_catcher:
|
||||
hooks_base.post_push(scm_extras)
|
||||
assert event_catcher.event_types == [RepoPushEvent]
|
||||
assert event_catcher.events_types == [RepoPushEvent]
|
||||
|
||||
|
||||
def test_push_fires_events(scm_extras):
|
||||
with EventCatcher() as event_catcher:
|
||||
hooks_base.pre_pull(scm_extras)
|
||||
assert event_catcher.event_types == [RepoPrePullEvent]
|
||||
assert event_catcher.events_types == [RepoPrePullEvent]
|
||||
|
||||
with EventCatcher() as event_catcher:
|
||||
hooks_base.post_pull(scm_extras)
|
||||
assert event_catcher.event_types == [RepoPullEvent]
|
||||
assert event_catcher.events_types == [RepoPullEvent]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue