def get(self, serviceName): args = MetadataListResourceParser.parseGetParameters() number = args[ARGS_NUMBER] offset = args[ARGS_OFFSET] query = args[ARGS_QUERY] objects = findMetadata(serviceName, number, offset, query) return objects, 200
def testMetadata(self): TEST_QUERY = {'json.dict.dict2.0': 1} TEST_NUMBER = 1 TEST_OFFSET = 0 TEST_SERVICE = 'testservice' VALID_LENGTH = 1 VALID_ID = ObjectId('552833515404411781370723') result = findMetadata(TEST_SERVICE, TEST_NUMBER, TEST_OFFSET, TEST_QUERY) result = list(result) self.assertEquals(len(result), VALID_LENGTH) self.assertEquals(result[0]['_id'], VALID_ID)