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