def test_event_slurp(): a = Event() b = Event() b.slurp(a.dump()) assert a.get('uuid') == b.get('uuid')
def test_event_slurp_bad(): a = Event() del(a.data["uuid"]) b = Event() try: b.slurp(a.dump()) except InvalidData: assert True else: assert False
def _generateNativeEvent(self, data={}, destination=None): ''' Gets mapps to self.generateEvent for `input` type modules and if ``Actor.config.protocol_event`` is ``True``. Args: data (dict): The dict representation of ``wishbone.event.Event``. destination (str): The destination str to store ``data``. In this particular implementation it's ignored. Returns: wishbone.event.Event: ``Event`` instance of ``data`` ''' e = Wishbone_Event() e.slurp(data) return e