예제 #1
0
파일: test_events.py 프로젝트: uraniid/maas
 def test__silent_when_no_node(self):
     event_type = factory.make_EventType()
     description = factory.make_name('description')
     # Exception should not be raised.
     events.send_event(
         factory.make_name('system_id'), event_type.name,
         description, datetime.datetime.utcnow())
예제 #2
0
 def test__creates_event_for_node(self):
     event_type = factory.make_EventType()
     node = factory.make_Node()
     description = factory.make_name('description')
     timestamp = datetime.datetime.utcnow()
     events.send_event(node.system_id, event_type.name, description,
                       timestamp)
     # Doesn't raise a DoesNotExist error.
     Event.objects.get(node=node,
                       type=event_type,
                       description=description,
                       created=timestamp)