Exemple #1
0
def test():
    task1 = DMTask()
    val = {"name": "fake-followers", "action_type": "loop", "start": 6001000, "end": 6005000}
    task1.init_test("github", val)
    e1 = GithubFollowers(task1)
    e1.runTask()
    task1.remove()
Exemple #2
0
def test():
    task1 = DMTask()
    val = {"name": "fake-repo", "action_type": "loop", "start": 6001000, "end": 6005000}

    task1.init_test("github", val)
    e1 = GithubRepo(task1)
    e1.runTask()
    task1.remove()
Exemple #3
0
def single_download_demo():
    task1 = DMTask()
    val = {
        "name": "fake-followers",
        "action_type": "loop",
        "start": 6001000,
        "end": 6005000
    }
    task1.init_test("github", val)
    e1 = GithubFollowers(task1)
    e1.upload_user_followers("002", 3269460, 2)
Exemple #4
0
def resolve_contributors_30():
    db = DMDatabase().getDB()

    task1 = DMTask()
    val = {"name": "fake-contributors", "action_type": "loop", "start": 0, "end": 1000}
    task1.init_test("github", val)
    e1 = GithubContributors(task1)

    for num in range(1, 300):
        res = db["contributors"].find({"count": num*30})
        res_list = []
        for item in res:
            res_list.append({"full_name": item["full_name"], "id": item["id"]})
        for item in res_list:
            e1.get_repo_contributors(item["full_name"], item["id"])
Exemple #5
0
def test():
    db = DMDatabase().getDB()
    res = db["event"].find({"id": {"$gte": 1000, "$lt": 200}}).limit(20)
    if res is None:
        print 'res is none'
    else:
        print res.count()
    return

    task1 = DMTask()
    val = {"name": "fake-event", "action_type": "loop", "start": 6001000, "end": 6005000}

    task1.init_test("github", val)
    e1 = GithubEvent(task1)
    e1.runTask()
    task1.remove()
Exemple #6
0
def single_download_demo(login, id, count):
    task1 = DMTask()
    val = {"name": "fake-followers", "action_type": "loop", "start": 6001000, "end": 6005000}
    task1.init_test("github", val)
    e1 = GithubFollowers(task1)
    e1.upload_user_followers(login, id, count)