mirror of
https://github.com/steelcityamir/safe-content-ai.git
synced 2024-08-17 14:20:34 +03:00
Updates
This commit is contained in:
parent
4c82208be9
commit
c875de688b
@ -1,4 +1,4 @@
|
||||
name: Pylint
|
||||
name: Python CI
|
||||
|
||||
on: [push]
|
||||
|
||||
@ -22,7 +22,10 @@ jobs:
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install -r test-requirements.txt
|
||||
pip install pylint
|
||||
- name: Analysing the code with pylint
|
||||
run: |
|
||||
pylint $(git ls-files '*.py')
|
||||
- name: Run tests with pytest
|
||||
run: pytest
|
@ -10,10 +10,11 @@ FILE_NAME = "sunflower.jpg"
|
||||
|
||||
def test_read_main():
|
||||
"""Tests that POST /api/v1/detect returns 200 OK with valid request body"""
|
||||
response = client.post(
|
||||
"/api/v1/detect",
|
||||
files={"file": (FILE_NAME, open(FILE_NAME, "rb"), "image/jpeg")},
|
||||
)
|
||||
with open(FILE_NAME, "rb") as file:
|
||||
response = client.post(
|
||||
"/api/v1/detect",
|
||||
files={"file": (FILE_NAME, file, "image/jpeg")},
|
||||
)
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {
|
||||
"file_name": FILE_NAME,
|
||||
|
Loading…
Reference in New Issue
Block a user