-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from djotaku/devel
Unit Tests, Linters, and User Requests, Oh My!
- Loading branch information
Showing
7 changed files
with
50 additions
and
18 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 |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
in because a new donation has ocurred. | ||
""" | ||
|
||
import sys | ||
import readparticipantconf | ||
|
||
|
||
|
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,11 +1,35 @@ | ||
import extralifedonations | ||
|
||
#run with command: py.test-3 extralifeunittests.py | ||
# run with command: py.test-3 extralifeunittests.py | ||
# or if in venv, just pytest extralifeunittests.py (works better) | ||
|
||
#Tests for class Donor | ||
|
||
# Tests for class Donor | ||
def test_Donor_lt(): | ||
donor1 = extralifedonations.Donor("donor1","message",45) | ||
donor2 = extralifedonations.Donor("donor2","message",30) | ||
""" Test to make sure comparison works. """ | ||
donor1 = extralifedonations.Donor("donor1", "message", 45) | ||
donor2 = extralifedonations.Donor("donor2", "message", 30) | ||
assert donor2 < donor1 | ||
|
||
#Tests for class Participant | ||
|
||
# Tests for class Participant | ||
# Come back and develop tests for get_participant_JSON and | ||
# get_donors after changing the methods to take input | ||
# and return a value. That will be in prep for refactoring. | ||
def test_donor_formatting_message_true(): | ||
""" Make sure the formatting works correctly. """ | ||
p = extralifedonations.Participant() | ||
donor1 = extralifedonations.Donor("donor1", "message", 45) | ||
formatted_message = p._donor_formatting(donor1, True) | ||
assert formatted_message == "donor1 - $45.00 - message" | ||
|
||
|
||
def test_donor_formatting_message_false(): | ||
""" Make sure the formatting works correctly. """ | ||
p = extralifedonations.Participant() | ||
donor1 = extralifedonations.Donor("donor1", "message", 45) | ||
formatted_message = p._donor_formatting(donor1, False) | ||
assert formatted_message == "donor1 - $45.00" | ||
|
||
# for the file writing don't forget to test donor names and messages with | ||
# characters like ñ and ô and emojis. |
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