Skip to content

Commit 3ef9c1b

Browse files
committed
Update thread_cache_test cases to include RateLimited field
1 parent 4e26ceb commit 3ef9c1b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

aikido_zen/thread/thread_cache_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def test_initialization(thread_cache: ThreadCache):
4242
assert thread_cache.config.blocked_uids == set()
4343
assert thread_cache.stats.get_record()["requests"] == {
4444
"total": 0,
45+
"rateLimited": 0,
4546
"aborted": 0,
4647
"attacksDetected": {"total": 0, "blocked": 0},
4748
}
@@ -77,6 +78,7 @@ def test_reset(thread_cache: ThreadCache):
7778
assert thread_cache.config.blocked_uids == set()
7879
assert thread_cache.stats.get_record()["requests"] == {
7980
"total": 0,
81+
"rateLimited": 0,
8082
"aborted": 0,
8183
"attacksDetected": {"total": 0, "blocked": 0},
8284
}
@@ -100,6 +102,7 @@ def test_renew_with_no_comms(thread_cache: ThreadCache):
100102
assert thread_cache.config.blocked_uids == set()
101103
assert thread_cache.stats.get_record()["requests"] == {
102104
"total": 0,
105+
"rateLimited": 0,
103106
"aborted": 0,
104107
"attacksDetected": {"total": 0, "blocked": 0},
105108
}
@@ -285,6 +288,7 @@ def test_renew_called_with_correct_args(mock_get_comms, thread_cache: ThreadCach
285288
"endedAt": -1,
286289
"requests": {
287290
"total": 2,
291+
"rateLimited": 0,
288292
"aborted": 0,
289293
"attacksDetected": {"blocked": 1, "total": 3},
290294
},
@@ -369,6 +373,7 @@ def test_sync_data_for_users(mock_get_comms, thread_cache: ThreadCache):
369373
"endedAt": -1,
370374
"requests": {
371375
"total": 1,
376+
"rateLimited": 0,
372377
"aborted": 0,
373378
"attacksDetected": {"total": 0, "blocked": 0},
374379
},
@@ -421,6 +426,7 @@ def test_renew_called_with_empty_routes(mock_get_comms, thread_cache: ThreadCach
421426
"endedAt": -1,
422427
"requests": {
423428
"total": 0,
429+
"rateLimited": 0,
424430
"aborted": 0,
425431
"attacksDetected": {"total": 0, "blocked": 0},
426432
},
@@ -461,6 +467,7 @@ def test_renew_called_with_no_requests(mock_get_comms, thread_cache: ThreadCache
461467
"endedAt": -1,
462468
"requests": {
463469
"total": 0,
470+
"rateLimited": 0,
464471
"aborted": 0,
465472
"attacksDetected": {"total": 0, "blocked": 0},
466473
},

0 commit comments

Comments
 (0)