Exemplo n.º 1
0
 def test_success(self):
     expected_resp = [u'https://github.com/rtnpro/django-pontoon-hook', u'https://github.com/rtnpro/askbot-devel', u'https://github.com/rtnpro/django-cms-bootstrap', u'https://github.com/rtnpro/angular.js', u'https://github.com/rtnpro/Armstrong-IDE', u'https://github.com/rtnpro/darkserver', u'https://github.com/rtnpro/django-bootstrap-toolkit', u'https://github.com/rtnpro/django-bulk', u'https://github.com/rtnpro/django-cms', u'https://github.com/rtnpro/django-filebrowser']
     resp = most_watched_repos('rtnpro', 10)
     self.assertEqual(resp, expected_resp)
Exemplo n.º 2
0
 def test_success(self, mock_requests_get):
     m = mock.Mock()
     m.content = '[{"watchers": 0, "html_url": "foo"}, {"watchers": 4, "html_url": "foobar"}, {"watchers": 1, "html_url": "blah"}]'
     mock_requests_get.return_value = m
     resp = most_watched_repos('blah', 10)
     self.assertEqual(resp, ["foobar", "blah", "foo"])