File size: 825 Bytes
cd5e987
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from datetime import datetime
from typing import List
from pathlib import Path
from fastapi import Depends
from fastapi.testclient import TestClient
import pytest

from app.model.transaction import Transaction
from app.schema.index import TransactionType, TransactionCreate

from sqlalchemy.ext.asyncio import AsyncSession
from app.engine.postgresdb import get_db_session

@pytest.mark.asyncio
async def test_file_upload(client: TestClient, get_db_session_fixture: AsyncSession) -> None:
    _test_upload_file = Path('/Users/patrickalexis/Documents/codepath-ai-course/codepath-group-project/backend/app/transactions_rag/transactions_2024.csv', 'new-index.json')
    _files = {'input_file': _test_upload_file.open('rb')}

    response = client.post(("/api/v1/file_upload/"),files=_files)
    assert response.status_code == 201