def testFindUsers(self): COLLECTION_USERS.insert(TEST_OBJ) RESULT = findUsers(TEST_NUMBER, TEST_OFFSET, TEST_LOGIN_SUBSTRING)[0] self.assertEquals(RESULT[LOGIN], VALID_RESULT) COLLECTION_USERS.insert(TEST_OBJ_1) COLLECTION_USERS.insert(TEST_OBJ_2) COLLECTION_USERS.insert(TEST_OBJ_3) COLLECTION_USERS.insert(TEST_OBJ_4) RESULT = findUsers( TEST_NUMBER_10, TEST_OFFSET, TEST_LOGIN_SUBSTRING_TEST) self.assertTrue(isSorted(RESULT, LOGIN))
def get(self): params = UserListResourceParser.parseGetParameters() users = findUsers(params[GET_ARGS_NUMBER], params[GET_ARGS_OFFSET], params[GET_ARGS_LOGIN]) return users
def testFindUsers(self): COLLECTION_USERS.insert(TEST_OBJ) RESULT = findUsers(TEST_NUMBER, TEST_OFFSET, TEST_LOGIN_SUBSTRING)[0] self.assertEquals(RESULT[LOGIN], VALID_RESULT)