@@ -528,15 +528,15 @@ def test_caching_article_count(app_client, redis_fixture):
528
528
with patch ("scholarag.app.middleware.get_cache" , redis_fixture ):
529
529
# First time to put in the cache
530
530
response = app_client .get (
531
- "/retrieval/article_count" , params = {"topics" : "random topic " }
531
+ "/retrieval/article_count" , params = {"topics" : "fake_title " }
532
532
)
533
533
534
534
assert response .json () == {"article_count" : 10 }
535
535
assert response .headers ["X-fastapi-cache" ] == "Miss"
536
536
537
537
# Second time to read in the cache
538
538
response = app_client .get (
539
- "/retrieval/article_count" ,
539
+ "/retrieval/article_count" , params = { "topics" : "fake_title" }
540
540
)
541
541
assert response .json () == {"article_count" : 10 }
542
542
assert response .headers ["X-fastapi-cache" ] == "Hit"
@@ -589,15 +589,15 @@ def test_caching_article_listing(app_client, redis_fixture, mock_http_calls):
589
589
with patch ("scholarag.app.middleware.get_cache" , redis_fixture ):
590
590
# First time to put in the cache
591
591
response = app_client .get (
592
- "/retrieval/article_listing" , params = {"topics" : "random topic " }
592
+ "/retrieval/article_listing" , params = {"topics" : "test " }
593
593
)
594
594
595
595
assert response .json () == expected
596
596
assert response .headers ["X-fastapi-cache" ] == "Miss"
597
597
598
598
# Second time to read in the cache
599
599
response = app_client .get (
600
- "/retrieval/article_listing" ,
600
+ "/retrieval/article_listing" , params = { "topics" : "test" }
601
601
)
602
602
assert response .json () == expected
603
603
assert response .headers ["X-fastapi-cache" ] == "Hit"
0 commit comments