Пример #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"