def testGetPointById(self): db = getDbObject(DB) obj_id = db[COLLECTION].save({NAME: 'test_GT_1304'}) with self.assertRaises(PointDoesNotExist): getPointById('testservice', '111111111111111111111111') obj = getPointById('testservice', obj_id) self.assertEqual(obj['name'], 'test_GT_1304')
def testJsonLDConversion(self): TEST_POINT = getPointById(TEST_SERVICE, TEST_POINT_ID) convertedPoint = convertPointToJsonLD(TEST_POINT) self.assertEquals(convertedPoint, VALID_POINT) TEST_LIST = [TEST_POINT] convertedList = convertPointsToJsonLD(TEST_LIST) self.assertEquals(convertedList, VALID_LIST)
def get(self, serviceName, pointId): newPoint = getPointById(serviceName, pointId) return newPoint