mirror of
https://github.com/ltcptgeneral/cs239-caching.git
synced 2025-09-08 16:27:23 +00:00
add get user id endpoint (/users),
fix issue in tiered cache, update basic test with new user id set
This commit is contained in:
@@ -10,10 +10,14 @@ endpoints = {
|
||||
"/user/{user_id}": 1
|
||||
}
|
||||
|
||||
user_ids = json.loads(requests.get(baseurl + "/users").content)["ids"]
|
||||
|
||||
random.seed(0)
|
||||
|
||||
def generate_random():
|
||||
x = random.choices(list(endpoints.keys()), list(endpoints.values()))[0] # select randomly from endpoint (keys) with weight (values)
|
||||
|
||||
random_user = str(random.randint(1, 3))
|
||||
random_user = str(random.choice(user_ids))
|
||||
x = x.replace("{user_id}", random_user)
|
||||
|
||||
return baseurl + x
|
||||
|
Reference in New Issue
Block a user