Add Unit Tests to verify the Reload API functions as desired

This commit is contained in:
Debanjum Singh Solanky
2022-06-29 23:09:48 +04:00
parent b89fc2f4ac
commit 2f7ef08b11
2 changed files with 60 additions and 0 deletions

View File

@@ -43,6 +43,28 @@ def test_search_with_valid_content_type(content_config: ContentConfig, search_co
assert response.status_code == 200
# ----------------------------------------------------------------------------------------------------
def test_reload_with_invalid_content_type():
# Act
response = client.get(f"/reload?t=invalid_content_type")
# Assert
assert response.status_code == 422
# ----------------------------------------------------------------------------------------------------
def test_reload_with_valid_content_type(content_config: ContentConfig, search_config: SearchConfig):
# Arrange
config.content_type = content_config
config.search_type = search_config
for content_type in ["notes", "ledger", "music", "image"]:
# Act
response = client.get(f"/reload?t={content_type}")
# Assert
assert response.status_code == 200
# ----------------------------------------------------------------------------------------------------
def test_regenerate_with_invalid_content_type():
# Act