-
Notifications
You must be signed in to change notification settings - Fork 56
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
Showing
14 changed files
with
155 additions
and
145 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
8 changes: 4 additions & 4 deletions
8
labs/dicts/morsecodepalindromes/test_main.py → ...ts/morsecodepalindromes/test_morsecode.py
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""Moduel to test important function in pet.py. | ||
""" | ||
|
||
import pet | ||
|
||
|
||
def test_answer() -> None: | ||
"""Tests answer function.""" | ||
ans = pet.answer([10, 20, 11, 15, 13]) | ||
expected = "2 20" | ||
assert ans == expected, f"Expected: {expected}, but got: {ans}" | ||
|
||
|
||
def test_answer2() -> None: | ||
"""Tests answer function.""" | ||
ans = pet.answer([6, 10, 8, 4, 15]) | ||
expected = "5 15" | ||
assert ans == expected, f"Expected: {expected}, but got: {ans}" | ||
|
||
# FIXME 1: add a test case function to test answer function | ||
# FIXME 2: add a test case function to test answer function | ||
|
||
|
||
def test_list_sum() -> None: | ||
"""Tests list_sum function.""" | ||
ans = pet.list_sum([6, 7, 8, 10]) | ||
expected = 31 | ||
assert ans == expected, f"Expected: {expected}, but got: {ans}" | ||
|
||
|
||
def test_list_sum2() -> None: | ||
"""Tests list_sum function.""" | ||
ans = pet.list_sum([2, 3, 4, 5]) | ||
expected = 14 | ||
assert ans == expected, f"Expected: {expected}, but got: {ans}" | ||
|
||
# FIXME 3: add a test case function to test list_sum function | ||
# FIXME 4: add a test case function to test list_sum function |
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
File renamed without changes.
15 changes: 9 additions & 6 deletions
15
labs/loops/oddities/test_main.py → labs/loops/oddities/test_oddities.py
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,39 +1,42 @@ | ||
"""Test cases for main.py""" | ||
import main | ||
"""Test cases for oddities.py""" | ||
import oddities | ||
|
||
|
||
def test_answer(): | ||
"""Test answer function.""" | ||
ans = main.answer(10) | ||
ans = oddities.answer(10) | ||
expected = "10 is even" | ||
assert ans == expected, f"Expected: {expected}, but got: {ans}" | ||
|
||
|
||
def test_answer2(): | ||
"""Test answer function for negavitve odd number.""" | ||
ans = main.answer(-199) | ||
ans = oddities.answer(-199) | ||
expected = "-199 is odd" | ||
assert ans == expected, f"Expected: {expected}, but got: {ans}" | ||
|
||
|
||
# FIXME 6: add a new test case function to test your answer function | ||
|
||
# FIXME 7: add a new test case function to test your answer function | ||
|
||
|
||
def test_odd_even(): | ||
"""Test odd_even function. | ||
""" | ||
ans = main.odd_even(10) | ||
ans = oddities.odd_even(10) | ||
expected = "even" | ||
assert ans == expected, f"Expected: {expected}, but got: {ans}" | ||
|
||
|
||
def test_odd_even2(): | ||
"""Test odd_even function for negavitve odd number | ||
""" | ||
ans = main.odd_even(-199) | ||
ans = oddities.odd_even(-199) | ||
expected = "odd" | ||
assert ans == expected, f"Expected: {expected}, but got: {ans}" | ||
|
||
|
||
# FIXME 8: add a new test case function to test your answer function | ||
|
||
# FIXME 9: add a new test case function to test your answer function |
Oops, something went wrong.