-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93d7eaa
commit f5281f5
Showing
4 changed files
with
4 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +0,0 @@ | ||
import pytest | ||
|
||
from pymeshup.skeleton import fib, main | ||
|
||
__author__ = "ruben_laptop" | ||
__copyright__ = "ruben_laptop" | ||
__license__ = "MPL-2.0" | ||
|
||
|
||
def test_fib(): | ||
"""API Tests""" | ||
assert fib(1) == 1 | ||
assert fib(2) == 1 | ||
assert fib(7) == 13 | ||
with pytest.raises(AssertionError): | ||
fib(-10) | ||
|
||
|
||
def test_main(capsys): | ||
"""CLI Tests""" | ||
# capsys is a pytest fixture that allows asserts agains stdout/stderr | ||
# https://docs.pytest.org/en/stable/capture.html | ||
main(["7"]) | ||
captured = capsys.readouterr() | ||
assert "The 7-th Fibonacci number is 13" in captured.out | ||