def testEventEqual2(self): e1 = Event("EventTypeUri", "", None) e2 = makeEvent(evtype="EventTypeUri") self.assertEqual(e1, e2, "testEventEqual2")
def testEventEqual4(self): e1 = Event("EventTypeUri", "EventSourceUri1", "payload") e2 = makeEvent(evtype="EventTypeUri", source="EventSourceUri2", payload="payload") self.assertNotEqual(e1, e2, "testEventEqual4")
def testEventCreate1(self): e = Event("EventTypeUri", "EventSourceUri", "payload") assert e.getType() == "EventTypeUri", "testEventCreate1, getType" assert e.getSource() == "EventSourceUri", "testEventCreate1, getSource" assert e.getPayload() == "payload", "testEventCreate1, getPayload"
def testEventCreate2(self): e = Event("EventTypeUri", "", None) assert e.getType() == "EventTypeUri", "testEventCreate2, getType" assert e.getSource() == "", "testEventCreate2, getSource" assert e.getPayload() == None, "testEventCreate2, getPayload"
def testEventEqual8(self): # test against object that is not an event e1 = Event("EventTypeUri", "EventSourceUri", "payload1") self.assertNotEqual(e1, DummyClass(), "testEventEqual7")
def testEventString1(self): e = Event("EventTypeUri", "EventSourceUri", "payload") es = """Event(evtype="EventTypeUri", source="EventSourceUri")""" self.assertEqual(str(e), es, "testEventString1: " + str(e))
def testEventEqual7(self): e1 = Event("EventTypeUri", "EventSourceUri", "payload1") self.assertNotEqual(e1, None, "testEventEqual7")
def testStatusEvent1(self): s = Status("StatusUri", "message", "values") e = s.makeEvent("SourceUri") assert e == Event("StatusUri", "SourceUri", s), "testStatusEvent1"
def testStatusEvent2(self): s = Status("StatusUri") e = s.makeEvent("SourceUri") assert e == Event("StatusUri", "SourceUri", s), "testStatusEvent2"