-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added verify and relative test #174
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ho corretto tutto e migliorato tutto quello indicato, lasciando l'array predefinito perchè la consegna lo richiede esplicitamente
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fatto tutto
fail_test_array = range(35,100) | ||
import src.verify as verify | ||
|
||
def test_verify(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rinomina la funzione, leggendo la firma del metodo non è chiaro cosa stai testando.
assert verify.is_element_in_list(i) == True | ||
for i in fail_test_array: | ||
if i not in success_test_array: | ||
assert verify.is_element_in_list(i) == False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cosa te ne pare di definire due funzioni separate? Una che testa solo i casi positivi e una solo i casi negativi.
Poi nel tuo metodo principale chiami entrambi.
|
||
def test_verify(): | ||
for i in success_test_array: | ||
assert verify.is_element_in_list(i) == True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== True
è superfluo.
Puoi usare
assert verify.is_element_in_list(i)
assert not verify.is_element_in_list(i)
Added verify exercise in src folder and relative test.
The test cover positive cases and negative cases.