Unit test for events in service engine

This patch adds unit test cases for events in service engine.

Change-Id: I3942f6fcbabbcaf6af9971fb28c5c487fe5f4608
This commit is contained in:
tengqm
2015-08-13 09:00:28 -04:00
parent 621793e202
commit 3e04607360
5 changed files with 210 additions and 9 deletions

View File

@@ -51,6 +51,12 @@ class Event(object):
self.cluster_id = kwargs.get('cluster_id', None)
self.metadata = kwargs.get('metadata', {})
ctx = kwargs.get('context', None)
if ctx is not None:
self.user = ctx.user
self.project = ctx.project
self.domain = ctx.domain
# entity not None implies an initial creation of event object,
# not a deserialization, so we try make an inference here
if entity is not None: