Spaces:
Paused
Paused
File size: 3,663 Bytes
ddc5bbd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
import os
from dotenv import dotenv_values
from fastapi import FastAPI
from pymongo import MongoClient
from main import requests
import uuid
import pytest
from dotenv import load_dotenv
import requests
import json
# Test Fuzzy Search Integrated component on existing call records
def test_search_pass():
# Test against records with mention of 'Football'
response = requests.get("http://127.0.0.1:8080/call/fuzzy-search/ozpHhyum3sayTdxIKUAtF51uvWJ2/football")
assert response.status_code == 200
assert len(response.json()) == 3 # three matching call transcripts
# Test Fuzzy Search Integrated component on existing call records
def test_search_pass2():
# Test against records with mention of 'Football' mispelled as 'Footbll'
response = requests.get("http://127.0.0.1:8080/call/fuzzy-search/ozpHhyum3sayTdxIKUAtF51uvWJ2/footbll")
assert response.status_code == 200
assert len(response.json()) == 3 # still three matching call transcripts
# Test Fuzzy Search Integrated component on existing call records
def test_search_fail():
# Test against records with mention of 'Football
response = requests.get("http://127.0.0.1:8080/call/fuzzy-search/ozpHhyum3sayTdxIKUAtF51uvWJ2/basketball")
assert response.status_code == 200
assert len(response.json()) == 0 # no matching call transcripts
# Test Summarisation Integrated component on existing call records
def test_summary_pass():
# Test with summarisation of english version transcript
response = requests.get("http://127.0.0.1:8080//call/summarise/FCnORXmLkw48G5mgscBV/ozpHhyum3sayTdxIKUAtF51uvWJ2/eng")
assert response.status_code == 200
def test_summary_pass2():
# Test with summarisation of polish version transcript
response = requests.get("http://127.0.0.1:8080//call/summarise/FCnORXmLkw48G5mgscBV/fNGMkWoSK7fxwE3tbp8E816sthd2/pol")
assert response.status_code == 200
def test_summary_fail():
# Test with summarisation of english version transcript
response = requests.get("http://127.0.0.1:8080//call/summarise/falseID/ozpHhyum3sayTdxIKUAtF51uvWJ2/eng") # non exising call record
assert response.status_code == 404
def test_summary_fail2():
# Test with summarisation of english version transcript
response = requests.get("http://127.0.0.1:8080//call/summarise/FCnORXmLkw48G5mgscBV/falseID/eng") # non exising user record
assert response.status_code == 404
# Test Key Key Extraction Integrated component on existing call records
def test_extraction_pass():
# Test against records with mention of 'Football'
response = requests.get("http://127.0.0.1:8080//call/term-extraction/FCnORXmLkw48G5mgscBV/ozpHhyum3sayTdxIKUAtF51uvWJ2/eng")
assert response.status_code == 200
assert len(response.json()) == 3 # still three matching call transcripts
# Test Fuzzy Search Integrated component on existing call records
def test_extracion_pass2():
# Test against records with mention of 'Football' mispelled as 'Footbll'
response = requests.get("http://127.0.0.1:8080//call/term-extraction/FCnORXmLkw48G5mgscBV/fNGMkWoSK7fxwE3tbp8E816sthd2/pol")
assert response.status_code == 200
assert len(response.json()) == 3 # still three matching call transcripts
# Test Fuzzy Search Integrated component on existing call records
def test_extraction_fail():
# Test against records with mention of 'Football
response = requests.get("http://127.0.0.1:8080//call/term-extraction/FCnORXmLkw48G5mgscBV/ozpHhyum3sayTdxIKUAtF51uvWJ2/eng")
assert response.status_code == 200
assert len(response.json()) == 0 # no matching call transcripts |