{"action":"created","comment":{"url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/comments/88786326","pull_request_review_id":9351356,"id":88786326,"diff_hunk":"@@ -0,0 +1,78 @@\n+\"\"\"\n+Name: Paul Briant\n+Date: 11/15/16\n+Class: Introduction to Python\n+Session: 03\n+Assignment: Mailroom Tests\n+\n+Description:\n+Tests for mailroom\n+\"\"\"\n+\n+# -------------------------------Imports----------------------------------------\n+import mailroom\n+\n+# -------------------------------Functions--------------------------------------\n+\n+\n+def test_list_donors():\n+    \"\"\"\n+    Verifies content of the list_donors output.\n+    \"\"\"\n+    donor_db = mailroom.donor_dict\n+    listing = mailroom.list_donors(donor_db)\n+    assert listing.startswith('Donors:\\n')\n+    assert \"Sheryl Sandberg\" in listing\n+    assert \"Satya Nadella\" in listing\n+    assert len(listing.split('\\n')) == 6\n+\n+\n+def test_find_donor():\n+    \"\"\"\n+    Checks to see if a donor exists but with varied whitespace and cases.\n+    \"\"\"\n+    assert mailroom.find_donor(\"satYa nADella \", mailroom.donor_dict)\n+\n+\n+def test_not_donor():\n+    \"\"\"\n+    Test a non-existent donor.\n+    \"\"\"\n+    donor_db = mailroom.donor_dict\n+    donor = mailroom.find_donor(\"Saya Nadella\", donor_db)\n+    assert donor is None\n+\n+\n+def test_create_letter():\n+    \"\"\"\n+    Test output of letter to ensure donor name and donation are present with\n+    correct formatting.\n+\n+    Question:\n+    Need to fix assert error when verifying start of letter.\n+    \"\"\"\n+    # Create test donor and donation amount\n+    name = \"Paul Briant\"\n+    amount = 200.00\n+    letter = mailroom.create_letter(name, amount)\n+    assert letter.startswith(\"Dear Paul Briant,\\n\")\n+    assert letter.endswith(\"-The Team\\n\")\n+    assert \"donation of $200.00!\\n\" in letter\n+\n+\n+def test_print_report():\n+    \"\"\"\n+    Test to ensure report is generated.\n+    \"\"\"\n+    donor_db = mailroom.donor_dict\n+    report = mailroom.print_report(donor_db)\n+    print(report)","path":"students/psbriant/session03/test_mailroom.py","position":69,"original_position":69,"commit_id":"e2dc3c0eed0883011202f484501f2e78e639e4b6","original_commit_id":"e2dc3c0eed0883011202f484501f2e78e639e4b6","user":{"login":"PythonCHB","id":1840917,"avatar_url":"https://avatars.githubusercontent.com/u/1840917?v=3","gravatar_id":"","url":"https://api.github.com/users/PythonCHB","html_url":"https://github.com/PythonCHB","followers_url":"https://api.github.com/users/PythonCHB/followers","following_url":"https://api.github.com/users/PythonCHB/following{/other_user}","gists_url":"https://api.github.com/users/PythonCHB/gists{/gist_id}","starred_url":"https://api.github.com/users/PythonCHB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PythonCHB/subscriptions","organizations_url":"https://api.github.com/users/PythonCHB/orgs","repos_url":"https://api.github.com/users/PythonCHB/repos","events_url":"https://api.github.com/users/PythonCHB/events{/privacy}","received_events_url":"https://api.github.com/users/PythonCHB/received_events","type":"User","site_admin":false},"body":"so this will test that the function will run without errors, which is a good start. Can you add some checks on the results?\r\n\r\n","created_at":"2016-11-19T19:44:16Z","updated_at":"2016-11-19T19:44:16Z","html_url":"https://github.com/UWPCE-PythonCert/IntroPython2016/pull/104#discussion_r88786326","pull_request_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/104","_links":{"self":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/comments/88786326"},"html":{"href":"https://github.com/UWPCE-PythonCert/IntroPython2016/pull/104#discussion_r88786326"},"pull_request":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/104","id":93888029,"html_url":"https://github.com/UWPCE-PythonCert/IntroPython2016/pull/104","diff_url":"https://github.com/UWPCE-PythonCert/IntroPython2016/pull/104.diff","patch_url":"https://github.com/UWPCE-PythonCert/IntroPython2016/pull/104.patch","issue_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/issues/104","number":104,"state":"open","locked":false,"title":"Session06 - Advanced Function Call and Unit Tests","user":{"login":"psbriant","id":5098504,"avatar_url":"https://avatars.githubusercontent.com/u/5098504?v=3","gravatar_id":"","url":"https://api.github.com/users/psbriant","html_url":"https://github.com/psbriant","followers_url":"https://api.github.com/users/psbriant/followers","following_url":"https://api.github.com/users/psbriant/following{/other_user}","gists_url":"https://api.github.com/users/psbriant/gists{/gist_id}","starred_url":"https://api.github.com/users/psbriant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psbriant/subscriptions","organizations_url":"https://api.github.com/users/psbriant/orgs","repos_url":"https://api.github.com/users/psbriant/repos","events_url":"https://api.github.com/users/psbriant/events{/privacy}","received_events_url":"https://api.github.com/users/psbriant/received_events","type":"User","site_admin":false},"body":"Added Kwargs lab, testing lab, refactored mailroom and mailroom tests.","created_at":"2016-11-16T02:02:17Z","updated_at":"2016-11-19T19:46:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e9a820abd061b050cc29e44d3f7dd40bccdafd2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/104/commits","review_comments_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/104/comments","review_comment_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/issues/104/comments","statuses_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/statuses/e2dc3c0eed0883011202f484501f2e78e639e4b6","head":{"label":"psbriant:master","ref":"master","sha":"e2dc3c0eed0883011202f484501f2e78e639e4b6","user":{"login":"psbriant","id":5098504,"avatar_url":"https://avatars.githubusercontent.com/u/5098504?v=3","gravatar_id":"","url":"https://api.github.com/users/psbriant","html_url":"https://github.com/psbriant","followers_url":"https://api.github.com/users/psbriant/followers","following_url":"https://api.github.com/users/psbriant/following{/other_user}","gists_url":"https://api.github.com/users/psbriant/gists{/gist_id}","starred_url":"https://api.github.com/users/psbriant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psbriant/subscriptions","organizations_url":"https://api.github.com/users/psbriant/orgs","repos_url":"https://api.github.com/users/psbriant/repos","events_url":"https://api.github.com/users/psbriant/events{/privacy}","received_events_url":"https://api.github.com/users/psbriant/received_events","type":"User","site_admin":false},"repo":{"id":70360512,"name":"IntroPython2016","full_name":"psbriant/IntroPython2016","owner":{"login":"psbriant","id":5098504,"avatar_url":"https://avatars.githubusercontent.com/u/5098504?v=3","gravatar_id":"","url":"https://api.github.com/users/psbriant","html_url":"https://github.com/psbriant","followers_url":"https://api.github.com/users/psbriant/followers","following_url":"https://api.github.com/users/psbriant/following{/other_user}","gists_url":"https://api.github.com/users/psbriant/gists{/gist_id}","starred_url":"https://api.github.com/users/psbriant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psbriant/subscriptions","organizations_url":"https://api.github.com/users/psbriant/orgs","repos_url":"https://api.github.com/users/psbriant/repos","events_url":"https://api.github.com/users/psbriant/events{/privacy}","received_events_url":"https://api.github.com/users/psbriant/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/psbriant/IntroPython2016","description":"Student class repository","fork":true,"url":"https://api.github.com/repos/psbriant/IntroPython2016","forks_url":"https://api.github.com/repos/psbriant/IntroPython2016/forks","keys_url":"https://api.github.com/repos/psbriant/IntroPython2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psbriant/IntroPython2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psbriant/IntroPython2016/teams","hooks_url":"https://api.github.com/repos/psbriant/IntroPython2016/hooks","issue_events_url":"https://api.github.com/repos/psbriant/IntroPython2016/issues/events{/number}","events_url":"https://api.github.com/repos/psbriant/IntroPython2016/events","assignees_url":"https://api.github.com/repos/psbriant/IntroPython2016/assignees{/user}","branches_url":"https://api.github.com/repos/psbriant/IntroPython2016/branches{/branch}","tags_url":"https://api.github.com/repos/psbriant/IntroPython2016/tags","blobs_url":"https://api.github.com/repos/psbriant/IntroPython2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psbriant/IntroPython2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psbriant/IntroPython2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/psbriant/IntroPython2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psbriant/IntroPython2016/statuses/{sha}","languages_url":"https://api.github.com/repos/psbriant/IntroPython2016/languages","stargazers_url":"https://api.github.com/repos/psbriant/IntroPython2016/stargazers","contributors_url":"https://api.github.com/repos/psbriant/IntroPython2016/contributors","subscribers_url":"https://api.github.com/repos/psbriant/IntroPython2016/subscribers","subscription_url":"https://api.github.com/repos/psbriant/IntroPython2016/subscription","commits_url":"https://api.github.com/repos/psbriant/IntroPython2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/psbriant/IntroPython2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/psbriant/IntroPython2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/psbriant/IntroPython2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/psbriant/IntroPython2016/contents/{+path}","compare_url":"https://api.github.com/repos/psbriant/IntroPython2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psbriant/IntroPython2016/merges","archive_url":"https://api.github.com/repos/psbriant/IntroPython2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psbriant/IntroPython2016/downloads","issues_url":"https://api.github.com/repos/psbriant/IntroPython2016/issues{/number}","pulls_url":"https://api.github.com/repos/psbriant/IntroPython2016/pulls{/number}","milestones_url":"https://api.github.com/repos/psbriant/IntroPython2016/milestones{/number}","notifications_url":"https://api.github.com/repos/psbriant/IntroPython2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psbriant/IntroPython2016/labels{/name}","releases_url":"https://api.github.com/repos/psbriant/IntroPython2016/releases{/id}","deployments_url":"https://api.github.com/repos/psbriant/IntroPython2016/deployments","created_at":"2016-10-08T22:22:16Z","updated_at":"2016-10-08T22:22:17Z","pushed_at":"2016-11-15T00:39:25Z","git_url":"git://github.com/psbriant/IntroPython2016.git","ssh_url":"git@github.com:psbriant/IntroPython2016.git","clone_url":"https://github.com/psbriant/IntroPython2016.git","svn_url":"https://github.com/psbriant/IntroPython2016","homepage":null,"size":4764,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"UWPCE-PythonCert:master","ref":"master","sha":"2b68d41247677ae243022963c6e29d32efc1fb62","user":{"login":"UWPCE-PythonCert","id":5218825,"avatar_url":"https://avatars.githubusercontent.com/u/5218825?v=3","gravatar_id":"","url":"https://api.github.com/users/UWPCE-PythonCert","html_url":"https://github.com/UWPCE-PythonCert","followers_url":"https://api.github.com/users/UWPCE-PythonCert/followers","following_url":"https://api.github.com/users/UWPCE-PythonCert/following{/other_user}","gists_url":"https://api.github.com/users/UWPCE-PythonCert/gists{/gist_id}","starred_url":"https://api.github.com/users/UWPCE-PythonCert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UWPCE-PythonCert/subscriptions","organizations_url":"https://api.github.com/users/UWPCE-PythonCert/orgs","repos_url":"https://api.github.com/users/UWPCE-PythonCert/repos","events_url":"https://api.github.com/users/UWPCE-PythonCert/events{/privacy}","received_events_url":"https://api.github.com/users/UWPCE-PythonCert/received_events","type":"Organization","site_admin":false},"repo":{"id":70018001,"name":"IntroPython2016","full_name":"UWPCE-PythonCert/IntroPython2016","owner":{"login":"UWPCE-PythonCert","id":5218825,"avatar_url":"https://avatars.githubusercontent.com/u/5218825?v=3","gravatar_id":"","url":"https://api.github.com/users/UWPCE-PythonCert","html_url":"https://github.com/UWPCE-PythonCert","followers_url":"https://api.github.com/users/UWPCE-PythonCert/followers","following_url":"https://api.github.com/users/UWPCE-PythonCert/following{/other_user}","gists_url":"https://api.github.com/users/UWPCE-PythonCert/gists{/gist_id}","starred_url":"https://api.github.com/users/UWPCE-PythonCert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UWPCE-PythonCert/subscriptions","organizations_url":"https://api.github.com/users/UWPCE-PythonCert/orgs","repos_url":"https://api.github.com/users/UWPCE-PythonCert/repos","events_url":"https://api.github.com/users/UWPCE-PythonCert/events{/privacy}","received_events_url":"https://api.github.com/users/UWPCE-PythonCert/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UWPCE-PythonCert/IntroPython2016","description":"Student class repository","fork":false,"url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016","forks_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/forks","keys_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/teams","hooks_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/hooks","issue_events_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/issues/events{/number}","events_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/events","assignees_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/assignees{/user}","branches_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/branches{/branch}","tags_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/tags","blobs_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/statuses/{sha}","languages_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/languages","stargazers_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/stargazers","contributors_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/contributors","subscribers_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/subscribers","subscription_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/subscription","commits_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/contents/{+path}","compare_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/merges","archive_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/downloads","issues_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/issues{/number}","pulls_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls{/number}","milestones_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/milestones{/number}","notifications_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/labels{/name}","releases_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/releases{/id}","deployments_url":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/deployments","created_at":"2016-10-05T00:28:33Z","updated_at":"2016-10-22T02:35:43Z","pushed_at":"2016-11-19T19:08:34Z","git_url":"git://github.com/UWPCE-PythonCert/IntroPython2016.git","ssh_url":"git@github.com:UWPCE-PythonCert/IntroPython2016.git","clone_url":"https://github.com/UWPCE-PythonCert/IntroPython2016.git","svn_url":"https://github.com/UWPCE-PythonCert/IntroPython2016","homepage":null,"size":5180,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":2,"forks":31,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/104"},"html":{"href":"https://github.com/UWPCE-PythonCert/IntroPython2016/pull/104"},"issue":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/issues/104"},"comments":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/UWPCE-PythonCert/IntroPython2016/statuses/e2dc3c0eed0883011202f484501f2e78e639e4b6"}}}}
{"actor":{"display_login":"PythonCHB"}}