Ejemplo n.º 1
0
    def testCheckEvents_SAME(self):
        '''Tests checking of local to remote event lists.'''

        crowded = [{"start": "2012-10-07T13:41:07.734000", "objectId": "protest", "subType": "tag"},
                   {"start": "2012-10-07T13:44:42.044000", "objectId": "spain", "subType": "tag"}]

        local =   [{"start": "2012-10-07T13:41:07.734000", "objectId": "protest", "subType": "tag"},
                   {"start": "2012-10-07T13:44:42.044000", "objectId": "spain", "subType": "tag"}]

        old, new = manEv.checkEvents(crowded, local)
        self.assertEquals(old, [])
        self.assertEquals(new, [])
Ejemplo n.º 2
0
    def testCheckEvents_MORELOCAL(self):
        '''Tests checking of local to remote event lists.'''

        local = [{"loc": [-0.128723, 51.526896999999998], "objectId": "1509201", "subType": "geography", "start": "2012-10-07T17:59:19.205000", "radius": 0.022141293728782822, "bbox": [[-0.15086429372878282, 51.504755706271219], [-0.10658170627121719, 51.549038293728778]], "radius_m": 1999},
                 {"start": "2012-10-07T13:41:07.734000", "objectId": "protest", "subType": "tag"},
                 {"start": "2012-10-07T13:44:42.044000", "objectId": "spain", "subType": "tag"}]

        crowded = [{"start": "2012-10-07T13:41:07.734000", "objectId": "protest", "subType": "tag"},
                   {"start": "2012-10-07T13:44:42.044000", "objectId": "spain", "subType": "tag"}]

        old, new = manEv.checkEvents(crowded, local)
        self.assertEquals(old, [{"loc": [-0.128723, 51.526896999999998], "objectId": "1509201", "subType": "geography", "start": "2012-10-07T17:59:19.205000", "radius": 0.022141293728782822, "bbox": [[-0.15086429372878282, 51.504755706271219], [-0.10658170627121719, 51.549038293728778]], "radius_m": 1999}])
        self.assertEquals(new, [])