Wrote a icon retrieval test
This commit is contained in:
parent
22a1227ee2
commit
4eaa17e0ce
1 changed files with 9 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import validators
|
||||||
|
|
||||||
from src.main import app
|
from src.main import app
|
||||||
from src.classes import product_classes
|
from src.classes import product_classes
|
||||||
|
from shop_validators import image_validator
|
||||||
|
|
||||||
client = TestClient(app)
|
client = TestClient(app)
|
||||||
|
|
||||||
|
|
@ -27,3 +28,11 @@ def test_retrieve_products():
|
||||||
returned_product = product_classes.Product(**response.json()[0])
|
returned_product = product_classes.Product(**response.json()[0])
|
||||||
|
|
||||||
default_product_test(returned_product)
|
default_product_test(returned_product)
|
||||||
|
|
||||||
|
def test_retrieve_icon():
|
||||||
|
response = client.get("/icons/cart")
|
||||||
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
returned_icon = response.text
|
||||||
|
|
||||||
|
assert image_validator.is_valid_svg(file_content=returned_icon)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue