Skip to content
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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

GiuseppeBnn
Copy link

Added verify exercise in src folder and relative test.
The test cover positive cases and negative cases.

src/verify.py Outdated Show resolved Hide resolved
src/verify.py Show resolved Hide resolved
tests/test_verify.py Outdated Show resolved Hide resolved
tests/test_verify.py Outdated Show resolved Hide resolved
Copy link
Author

@GiuseppeBnn GiuseppeBnn left a 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

Copy link
Author

@GiuseppeBnn GiuseppeBnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fatto tutto

@makapx makapx self-requested a review November 8, 2023 17:57
fail_test_array = range(35,100)
import src.verify as verify

def test_verify():

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

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

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants