def ou_action(dia): oh = ohloh.get_ohloh() data, web_response = oh.get_contribution_info_by_ohloh_username( dia.query, person=dia.person) dia.web_response = web_response dia.save() return data
def test_ohloh_errors_correctly_even_when_we_send_her_spaces(self): oh = ohloh.get_ohloh() self.assertRaises(ValueError, oh.get_icon_for_project, 'surely nothing is called this name')
def test_ohloh_errors_on_project_lacking_icon(self): oh = ohloh.get_ohloh() self.assertRaises(ValueError, oh.get_icon_for_project, 'asdf')
def test_ohloh_errors_on_nonexistent_project(self): oh = ohloh.get_ohloh() self.assertRaises(ValueError, oh.get_icon_for_project, 'lolnomatxh')
def test_ohloh_gives_us_an_icon(self): oh = ohloh.get_ohloh() icon = oh.get_icon_for_project('f-spot') icon_fd = StringIO(icon) image = mysite.base.depends.Image.open(icon_fd) self.assertEqual(image.size, (64, 64))