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