示例#1
0
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
示例#2
0
 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')
示例#3
0
 def test_ohloh_errors_on_project_lacking_icon(self):
     oh = ohloh.get_ohloh()
     self.assertRaises(ValueError, oh.get_icon_for_project, 'asdf')
示例#4
0
 def test_ohloh_errors_on_nonexistent_project(self):
     oh = ohloh.get_ohloh()
     self.assertRaises(ValueError, oh.get_icon_for_project, 'lolnomatxh')
示例#5
0
 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))
示例#6
0
 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')
示例#7
0
 def test_ohloh_errors_on_project_lacking_icon(self):
     oh = ohloh.get_ohloh()
     self.assertRaises(ValueError, oh.get_icon_for_project, 'asdf')
示例#8
0
 def test_ohloh_errors_on_nonexistent_project(self):
     oh = ohloh.get_ohloh()
     self.assertRaises(ValueError, oh.get_icon_for_project, 'lolnomatxh')
示例#9
0
 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))