def setUp(self): DeviceIndividual.delete_all() self.D = device.create(**{ "deviceManufacturerID": "ABCD1234567", "deviceType": "Type", "deviceManufacturer": "Manufacturer", "dateCreated": "2015-09-29T14:00:00+03:00", "dateEdited": "2015-09-29T14:00:00+03:00" }) self.D2 = device.create(**{ "deviceManufacturerID": "ABCD1234568", "deviceType": "Type", "deviceManufacturer": "Manufacturer", "dateCreated": "2015-09-29T14:00:00+03:00", "dateEdited": "2015-09-29T14:00:00+03:00" }) self.I = individual.create("Lintu1", "test") self.I2 = individual.create("Lintu2", "test")
def _manufacturerIDCheck(collections, devices, parser, manufacturerID): if manufacturerID not in devices: found = device.find(deviceManufacturerID=manufacturerID) if not found: dev = device.create(parser_Info(parser)['deviceType'], parser_Info(parser)['deviceManufacturer'], manufacturerID) else: dev = found[0] collections[dev.id] = [] devices[manufacturerID]=dev.id return devices[manufacturerID]
def setUp(self): dev = { "deviceId": "ABCD1234567", "deviceType": "Type", "deviceManufacturer": "Manufacturer", "createdAt": "2015-09-29T14:00:00+03:00", "lastModifiedAt": "2015-09-29T14:00:00+03:00", "facts": [] } self.d = device.create(**dev)
def test_get_public_gatherings(self): dev = device.create("Type", "Manu", "DeviceId", "2000-02-02T20:20:20+00:00", "2000-02-02T20:20:20+00:00") document.create( [gathering.Gathering("2012-01-01T00:00:00+00:00", [10.0, 10.0], publicityRestrictions="MZ.publicityRestrictionsPublic"), gathering.Gathering("2013-02-02T00:00:00+00:00", [11.0, 11.0], publicityRestrictions="MZ.publicityRestrictionsPublic"), gathering.Gathering("2013-02-02T00:00:00+00:00", [10.0, 10.0], publicityRestrictions="MZ.publicityRestrictionsPrivate")], dev.id) dev.attach_to(self.ind.id, "2013-01-01T00:00:00+00:00") gatherings = self.ind.get_public_gatherings() self.assertEquals(1, len(gatherings))
def setUp(self): self.c = Client() self.A = device.create("type","Manufacturer1",'1234TEST_A',"2015-10-27T16:32:01+00:00", "2015-10-27T16:32:01+00:00") self.B = device.create("type","Manufacturer2","1234TEST_B","2015-10-27T16:32:01+00:00", "2015-10-27T16:32:01+00:00") self.indiv = individual.create("Lintu1","Tax")