banesullivan / scooby

🐶 🕵️ Great Dane turned Python environment detective
MIT License
47 stars 12 forks source link

Testing #20

Closed banesullivan closed 5 years ago

banesullivan commented 5 years ago

We need real tests and we need to report code coverage. The current tests are minimal at best.

prisae commented 5 years ago

One test should assure html and plain versions have the same info.

from bs4 import BeautifulSoup

out = scooby.Report()

text_html = BeautifulSoup(out._repr_html_()).get_text()
text_plain = out.__repr__()

text_plain = " ".join(re.findall("[a-zA-Z1-9]+", text_plain))
text_html = " ".join(re.findall("[a-zA-Z1-9]+", text_html))

# Plain text currently starts with `Date :`;
# we should remove that, or add it to the html version too.
assert text_html == text_plain[5:]
prisae commented 5 years ago

And we should use the two packages

to check these cases

banesullivan commented 5 years ago

Added those tests in a new pytest suite