def test_dame_perceval_list_mailers_method_returns_correct_result(self):
     gg = DamePerceval()
     self.assertTrue(
         len(
             gg.list_mailers(
                 'http://mail-archives.apache.org/mod_mbox/httpd-announce/')
         ) >= 0)
 def test_dame_perceval_list_committers_method_returns_correct_result(self):
     dp = DamePerceval()
     l = dp.list_committers("https://github.com/davidam/davidam.git",
                            "/tmp/clonedir")
     arr = dp.count_gender_in_list(l)
     self.assertEqual(int(arr[0]), 0)
     self.assertEqual(int(arr[1]), 3)
 def test_dame_perceval_github_json_user_method_returns_correct_result(
         self):
     dp = DamePerceval()
     j = dp.get_github_json_user("davidam")
     self.assertEqual(j["id"], 1023217)
     self.assertEqual(j["blog"], "http://www.davidam.com")
     self.assertEqual(j["html_url"], "https://github.com/davidam")
     self.assertEqual(
         j["avatar_url"],
         "https://avatars2.githubusercontent.com/u/1023217?v=4")
Esempio n. 4
0
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA,

from app.dame_sexmachine import DameSexmachine
from app.dame_perceval import DamePerceval
from app.dame_utils import DameUtils
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("url", help="Uniform Resource Link")
parser.add_argument('--directory')
parser.add_argument('--version', action='version', version='0.1')
args = parser.parse_args()
if (len(sys.argv) > 1):
    s = DameSexmachine()
    gg = DamePerceval()
    du = DameUtils()
    l = gg.list_mailers(args.url)
    l = du.delete_duplicated(l)

    females = 0
    males = 0
    unknowns = 0
    for g in l:
        sm = s.guess(g, binary=True)
        if (sm == 0):
            females = females + 1
        elif (sm == 1):
            males = males + 1
        else:
            unknowns = unknowns + 1
Esempio n. 5
0
# Boston, MA 02110-1301 USA,

from app.dame_sexmachine import DameSexmachine
from app.dame_perceval import DamePerceval
from app.dame_utils import DameUtils
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("url", help="Uniform Resource Link")
parser.add_argument('--directory')
parser.add_argument('--version', action='version', version='0.1')
args = parser.parse_args()
if (len(sys.argv) > 1):
    ds = DameSexmachine()
    du = DameUtils()
    dp = DamePerceval()
    l1 = dp.list_committers(args.url, args.directory)
    l2 = du.delete_duplicated(l1)
    l3 = du.clean_list(l2)

    females = 0
    males = 0
    unknowns = 0
    for g in l3:
        sm = ds.guess(g, binary=True)
        if (sm == 0):
            females = females + 1
        elif (sm == 1):
            males = males + 1
        else:
            unknowns = unknowns + 1
 def test_dame_perceval_list_committers_method_returns_correct_result(self):
     gg = DamePerceval()
     self.assertEqual(
         len(
             gg.list_committers("https://github.com/davidam/davidam.git",
                                "/tmp/clonedir")), 3)
 def test_dame_perceval_list_mailers_method_returns_correct_result(self):
     gg = DamePerceval()
     n = gg.numMails(
         "http://mail-archives.apache.org/mod_mbox/httpd-announce/")
     self.assertTrue(n >= 0)
 def test_dame_perceval_secondName_method_returns_correct_result(self):
     gg = DamePerceval()
     second = gg.secondName("Santiago Dueñas")
     self.assertEquals(second, "Dueñas")
 def test_dame_perceval_firstName_method_returns_correct_result(self):
     gg = DamePerceval()
     first = gg.firstName("Santiago Dueñas")
     self.assertEquals(first, "Santiago")
 def test_dame_perceval_removeMail_method_returns_correct_result(self):
     gg = DamePerceval()
     nomail = gg.removeMail("Santiago Dueñas <*****@*****.**>")
     self.assertEquals(nomail, "Santiago Dueñas")
 def test_dame_perceval_numcommits_method_returns_correct_result(self):
     gg = DamePerceval()
     n = gg.numCommits("https://github.com/davidam/davidam.git",
                       "/tmp/clonedir")
     self.assertTrue(50 < n)
Esempio n. 12
0
 def test_dame_perceval_list_committers_method_returns_correct_result(self):
     gg = DamePerceval()
     self.assertTrue(len(gg.list_committers("https://github.com/grimoirelab/perceval.git", "/tmp/clonedir")) > 100)