Commits

Brad Montgomery committed d47beeb

removed the incomplete unittests, and updated the nosetests

Comments (0)

Files changed (3)

bitbucket/tests/test_bitbucket.py

-from nose.tools import eq_
+from nose.tools import eq_, ok_
 from bitbucket import *
 
 
     eq_("<Repository: bkmontgomery's python-bitbucket>", '%s' % repo)
 
     repos = user.repositories()
-    eq_(len(repos) > 0, True)
+    ok_(len(repos) > 0)
     eq_(len(filter(lambda x: x['name'] == 'python-bitbucket', repos)), 1)
 
     # events
     events = user.events()
     eq_(events.keys(), [u'count', u'events'])
-    eq_(len(events['events']) > 0, True)
+    ok_(len(events['events']) > 0)
 
     # get
     u = user.get()
     
     # get
     data = repo.get()
-    eq_(data.keys(), [u'website', u'name', u'description', u'followers_count', u'owner', u'logo', u'slug', u'resource_uri'])
+
+    # grab the fields associated with a repo, and verify that a few
+    # of the expected ones are present.
+    keys = data.keys()
+    ok_(len(keys) > 0)
+    ok_('website' in keys)
+    ok_('name' in keys)
+    ok_('description' in keys)
+    ok_('followers_count' in keys)
+    ok_('owner' in keys)
+    ok_('resource_uri' in keys)
     eq_(data['name'], u'python-bitbucket')
     eq_(data['slug'], u'python-bitbucket')
 
     # changeset
     cset = repo.changeset('37e6264f654b')
-    eq_(len(cset.keys()) > 0, True)
+    ok_(len(cset.keys()) > 0)
     eq_(cset['node'], u'37e6264f654b')
     eq_(cset['message'], u'typo fix')
 
     eq_(csets.keys(), [u'count', u'start', u'limit', u'changesets'])
     eq_(csets['limit'], 1)
     eq_(csets['start'], None)
-    eq_(len(csets['changesets']) > 0, True)
+    ok_(len(csets['changesets']) > 0)
 
     # parse_changeset_for_author (user the above ``cset``)
     data = repo.parse_changeset_for_author(cset)
     eq_(data['author'], u'bkmontgomery')
     eq_(data['email'], u'brad@bradmontgomery.net')
     eq_(data['gravatar_id'], 'd57aec10399cbb252bd890c2bb3fe1c9')
-    eq_(u'Brad Montgomery' in data['name'], True)
+    ok_(u'Brad Montgomery' in data['name'])
 
     # tags
     tags = repo.tags()
-    eq_('tip' in tags.keys(), True)
+    ok_('tip' in tags.keys())
 
     # branches
     branches = repo.branches()
-    eq_('default' in branches.keys(), True)
+    ok_('default' in branches.keys())
 
     # issues
     issue = repo.issue(1)
     eq_('%s' % issue, "<Issue #1 on bkmontgomery's python-bitbucket>")
 
     issues = repo.issues()
-    eq_(issues['count'] > 0, True)
-    eq_(len(issues['issues']) > 0, True)
+    ok_(issues['count'] > 0)
+    ok_(len(issues['issues']) > 0)
 
     # events
     events = repo.events()
     eq_(events.keys(), [u'count', u'events'])
-    eq_(len(events['events']) > 0, True)
+    ok_(len(events['events']) > 0)
 
     # followers
     followers = repo.followers()
     eq_(followers.keys(), [u'count', u'followers'])
-    eq_(len(followers['followers']) > 0, True)
-    eq_(u'bkmontgomery'  in [u['username'] for u in followers['followers']], True)
+    ok_(len(followers['followers']) > 0)
+    ok_(u'bkmontgomery' in [u['username'] for u in followers['followers']])
 
     # forks/fork
-    eq_(repo.forks() > 0, True)
-    eq_(repo.fork(), True)
+    ok_(repo.forks() > 0)
+    ok_(repo.fork())
 
     # contributors
     contributors = repo.contributors()
-    eq_('contributors' in contributors.keys(), True)
-    eq_(len(contributors['contributors']) > 0, True)
+    ok_('contributors' in contributors.keys())
+    ok_(len(contributors['contributors']) > 0)
 
     # __repr__
     eq_("%s" % repo, "<Repository: bkmontgomery's python-bitbucket>")
     # followers
     followers = issue.followers()
     eq_(followers.keys(), [u'count', u'followers'])
-    eq_(len(followers['followers']) > 0, True)
+    ok_(len(followers['followers']) > 0)

tests/__init__.py

Empty file removed.

tests/pythonbitbucket.py

-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""pythonbitbucket tests."""
-
-from unittest import TestCase
-
-class pythonbitbucketTest(TestCase):
-    def setUp(self):
-        pass
-
-    def tearDown(self):
-        pass
-