Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Add tests for user_info in the db already
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Sep 5, 2013
1 parent 6ceceac commit b422b51
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_elsewhere_bitbucket.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from __future__ import print_function, unicode_literals

from gittip.elsewhere import bitbucket
from gittip.testing import Harness


class TestElsewhereBitbucket(Harness):

def test_get_user_info_gets_user_info(self):
bitbucket.BitbucketAccount("1", {'username': 'alice'}).opt_in('alice')
expected = {"username": "alice"}
actual = bitbucket.get_user_info('alice')
assert actual == expected, actual
8 changes: 8 additions & 0 deletions tests/test_elsewhere_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


class TestElsewhereGithub(Harness):

def test_github_resolve_resolves_correctly(self):
alice_on_github = github.GitHubAccount("1", {'login': 'alice'})
alice_on_github.opt_in('alice')
Expand All @@ -31,3 +32,10 @@ def test_github_user_info_status_handling(self, requests):
requests.get().text = github_content
response = client.get('/on/github/not-in-the-db/')
assert_equal(response.code, expected_gittip_response)


def test_get_user_info_gets_user_info(self):
github.GitHubAccount("1", {'login': 'alice'}).opt_in('alice')
expected = {"login": "alice"}
actual = github.get_user_info('alice')
assert actual == expected, actual
7 changes: 7 additions & 0 deletions tests/test_elsewhere_twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ def test_twitter_resolve_resolves(self):
expected = 'alice'
actual = twitter.resolve(u'alice')
assert actual == expected, actual


def test_get_user_info_gets_user_info(self):
twitter.TwitterAccount("1", {'screen_name': 'alice'}).opt_in('alice')
expected = {"screen_name": "alice"}
actual = twitter.get_user_info('alice')
assert actual == expected, actual

0 comments on commit b422b51

Please sign in to comment.