Skip to content

Commit

Permalink
added login test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hebo committed Nov 11, 2010
1 parent dcb57ef commit af6032e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion pages.py
Expand Up @@ -113,7 +113,6 @@ def __init__(self):
self.user = None

def login(self, user, passwd):

self.user = user

params = urllib.urlencode({
Expand Down
9 changes: 8 additions & 1 deletion tests.py
Expand Up @@ -73,7 +73,14 @@ def testReturnStories(self):
handler = pages.RedditHandler()
for s in handler.download_stories(None, None, None)[0]:
self.assertIsInstance(s, pages.Story)


class TestLogin(unittest.TestCase):

def testInvalidLogin(self):
"""login attempt should fail"""
handler = pages.RedditHandler()
self.assertFalse(handler.login("gsdfgsdfg", "sdfgsfgsgf"))


if __name__ == "__main__":
unittest.main()

0 comments on commit af6032e

Please sign in to comment.