PYTEST - daehyun99/Translate-app GitHub Wiki

์‹คํ–‰ ์ฝ”๋“œ

pytest tests/ --cov=. -s

# or

pytest tests/ --cov=. --cov-report=term-missing -s

ํ…Œ์ŠคํŠธ ๋กœ๋“œ๋งต

ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ (FastAPI Endpoint) (v0.6.0)

  • test_integration_speech2text.py
set RUN_INTEGRATION=true && pytest tests/test_integration_speech2text.py -s --cov=app --cov-report=term-missing
  • test_integration_translate.py
set RUN_INTEGRATION=true && pytest tests/test_integration_translate.py -s --cov=app --cov-report=term-missing

๊ธฐ๋Šฅ ๋‹จ์œ„ ํ…Œ์ŠคํŠธ (temp-mileston (pytest))

  • Speech2Text
    Todo
    1. download_video ์‹คํŒจ
        - ํด๋ผ์ด์–ธํŠธ
            - ์ž˜๋ชป๋œ ํ˜•์‹์˜ URL, ์กด์žฌํ•˜์ง€ ์•Š๋Š” URL
            - ์‚ญ์ œ๋œ ์˜์ƒ, ๋น„๊ณต๊ฐœ ์˜์ƒ
        - ์„œ๋ฒ„
            - ๋„คํŠธ์›Œํฌ ๋ฌธ์ œ
            - ๋””์Šคํฌ ์šฉ๋Ÿ‰ ๋ถ€์กฑ
            - yt_dlp, ffmpeg
    
    2. rename_video ์‹คํŒจ
        - ํด๋ผ์ด์–ธํŠธ
            - None
        - ์„œ๋ฒ„
            - None
    
    3. transcribe ์‹คํŒจ
        - ํด๋ผ์ด์–ธํŠธ
            - None
        - ์„œ๋ฒ„
            - None
    
    4. delete_video ์‹คํŒจ
        - ํด๋ผ์ด์–ธํŠธ
            - None
        - ์„œ๋ฒ„
            - None
    
    5. delete_file ์‹คํŒจ
        - ํด๋ผ์ด์–ธํŠธ
            - None
        - ์„œ๋ฒ„
            - None
  • Translate
    Todo
    1. upload_file ์‹คํŒจ
        - ํด๋ผ์ด์–ธํŠธ
            - None
        - ์„œ๋ฒ„
            - None
    
    2. translate_ ์‹คํŒจ
        - ํด๋ผ์ด์–ธํŠธ
            - None
        - ์„œ๋ฒ„
            - None
        
    3. delete_file ์‹คํŒจ
        - ํด๋ผ์ด์–ธํŠธ
            - None
        - ์„œ๋ฒ„
            - None

์„ฑ๋Šฅ ํ…Œ์ŠคํŠธ (None)

  • None

์ฃผ์˜ํ•  ์ 

  1. ํŒŒ์ผ ์ด๋ฆ„์€ test_*.py ๋˜๋Š” *_test.py ํ˜•์‹์ด์–ด์•ผ ํ•จ
  2. ํ…Œ์ŠคํŠธ ํ•จ์ˆ˜๋Š” ๋ฐ˜๋“œ์‹œ def test_*(): ํ˜•ํƒœ์—ฌ์•ผ pytest๊ฐ€ ์ธ์‹ํ•จ

Reference

โš ๏ธ **GitHub.com Fallback** โš ๏ธ