testing working 08/03/2022
This commit is contained in:
parent
c45f7968ce
commit
248d2021be
5 changed files with 15 additions and 7 deletions
Binary file not shown.
Binary file not shown.
|
|
@ -4,4 +4,5 @@ today
|
|||
weather
|
||||
test
|
||||
/usr/local/bin/python3 "/Volumes/GoogleDrive-100976413726208790908/My Drive/UNI/INFS 2048 - System Design and Realisation/Assessment 2B/main.py"
|
||||
weather
|
||||
weather
|
||||
today
|
||||
2
main.py
2
main.py
|
|
@ -5,7 +5,7 @@ import pytest
|
|||
def jaccard_similarity(userQuestion, questionBank):
|
||||
s1 = set(userQuestion)
|
||||
s2 = set(questionBank)
|
||||
return float(len(s1.intersection(s2)) / len(s1.union(s2)))
|
||||
return float(len(s1.intersection(s2)) / len(s1.union(s2)))
|
||||
|
||||
def most_likely(userQuestion):
|
||||
likelihoodScore = []
|
||||
|
|
|
|||
|
|
@ -1,7 +1,14 @@
|
|||
from main import jaccard_similarity, most_likely
|
||||
import main
|
||||
import pytest
|
||||
|
||||
def test_CanInstantiatejaccard_similarity():
|
||||
co = jaccard_similarity(userQuestion="whats the weather like",questionBank="Sunny")
|
||||
#def test_CanInstantiatejaccard_similarity():
|
||||
# co = main.jaccard_similarity(userQuestion="Weather", questionBank="Same as yesterday.")
|
||||
# assert main.jaccard_similarity(float)
|
||||
|
||||
def test_most_likely():
|
||||
co = most_likely(userQuestion="Weather")
|
||||
def test_likelyQuestion():
|
||||
likelyQuestion = main.most_likely("weather today")
|
||||
assert likelyQuestion['question'] == 'What is the weather like today?'
|
||||
|
||||
def test_likelyAnswer():
|
||||
likelyAnswer = main.most_likely("weather today")
|
||||
assert likelyAnswer['answer'] == 'Same as yesterday.'
|
||||
Loading…
Reference in a new issue