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