Ejemplo n.º 1
0
 def testEventEqual2(self):
     e1 = Event("EventTypeUri", "", None)
     e2 = makeEvent(evtype="EventTypeUri")
     self.assertEqual(e1, e2, "testEventEqual2")
Ejemplo n.º 2
0
 def testEventEqual4(self):
     e1 = Event("EventTypeUri", "EventSourceUri1", "payload")
     e2 = makeEvent(evtype="EventTypeUri",
                    source="EventSourceUri2",
                    payload="payload")
     self.assertNotEqual(e1, e2, "testEventEqual4")
Ejemplo n.º 3
0
 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"
Ejemplo n.º 4
0
 def testEventCreate2(self):
     e = Event("EventTypeUri", "", None)
     assert e.getType() == "EventTypeUri", "testEventCreate2, getType"
     assert e.getSource() == "", "testEventCreate2, getSource"
     assert e.getPayload() == None, "testEventCreate2, getPayload"
Ejemplo n.º 5
0
 def testEventEqual8(self):
     # test against object that is not an event
     e1 = Event("EventTypeUri", "EventSourceUri", "payload1")
     self.assertNotEqual(e1, DummyClass(), "testEventEqual7")
Ejemplo n.º 6
0
 def testEventString1(self):
     e = Event("EventTypeUri", "EventSourceUri", "payload")
     es = """Event(evtype="EventTypeUri", source="EventSourceUri")"""
     self.assertEqual(str(e), es, "testEventString1: " + str(e))
Ejemplo n.º 7
0
 def testEventEqual7(self):
     e1 = Event("EventTypeUri", "EventSourceUri", "payload1")
     self.assertNotEqual(e1, None, "testEventEqual7")
Ejemplo n.º 8
0
 def testEventCreate2(self):
     e = Event("EventTypeUri", "", None)
     assert e.getType()    == "EventTypeUri",   "testEventCreate2, getType"
     assert e.getSource()  == "",               "testEventCreate2, getSource"
     assert e.getPayload() == None,             "testEventCreate2, getPayload"
Ejemplo n.º 9
0
 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"
Ejemplo n.º 10
0
 def testStatusEvent1(self):
     s = Status("StatusUri", "message", "values")
     e = s.makeEvent("SourceUri")
     assert e == Event("StatusUri", "SourceUri", s), "testStatusEvent1"
Ejemplo n.º 11
0
 def testStatusEvent2(self):
     s = Status("StatusUri")
     e = s.makeEvent("SourceUri")
     assert e == Event("StatusUri", "SourceUri", s), "testStatusEvent2"