コード例 #1
0
ファイル: test.py プロジェクト: Distelli/Senior-Project
    testBounty('8.8.8.8:88888888888888',"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",1440,"Malformed bounty 3 (ip failure)")
    testBounty('8.8.12348.8',"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",1440,"Malformed bounty 4 (ip failure)")
    testBounty('8.8.8.8:8888',"1JTGcHS3GMhBGGww4ZEDmP7u9",1440,"Malformed bounty 5 (btc failure)")
    testBounty('8.8.8.8:8888',"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",-1440,"Malformed bounty 6 (reward failure)")
    testBounty('8.8.8.8:8888',"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",0,"Malformed bounty 7 (signature failure)")
    testBounty('8.8.8.8:8888',"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",1440,"Malformed bounty 8 (requirement failure)", data={'reqs':{("__builtins__","pow",2,2):4}})
    testBounty('8.8.8.8:8888',"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",1440,"Correctly formed bounty 2", data={'reqs':{("sys","platform","index=2","end=3"):"win33"}})
    testBounty('8.8.8.8:8888',"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",1440,"Malformed bounty 10 (requirements failure)", data={'reqs':{("__builtins__","pow",2,2):4,("sys","platform"):"win33"}})
    testBounty('8.8.8.8:8888',"1LhPsd4ng3AXmVPzrLWprWFx351pW4HJm8",10900,"Correctly formed bounty 3")
    testBounty('8.8.8.8:8888',"1MWSdYMKEpfWVxC6BGYARxsksaQuyEWzG5",1480,"Correctly formed bounty 4")
    testBounty('8.8.8.8:8888',"1EgGfDetymjMzcQ1AEhHjHEyXHjnEavwgg",10290,"Correctly formed bounty 5")
    safeprint(bounty.getBountyList())
    bounty.saveToFile(bounty.getBountyList())
    bounty.loadFromFile()
    safeprint(bounty.getBountyList())
    safeprint("3 bounties should follow")
    safeprint(bounty.getBounty(settings.config.get('charity'),settings.config.get('propagate_factor')))
    safeprint(bounty.getBounty(False,2))
    safeprint(bounty.getBounty(True,2))
    settings.saveSettings()
    settings.loadSettings()
    saveToFile()
    getFromFile()
    if not (sys.version_info[0] < 3 and sys.platform == "win32"):
        safeprint("Test listener begin")
        v = Value('b',True)
        q = Queue()
        a = Process(target=waitForty,args=(v,q))
        a.start()
        listen(44566,False,q,v,False)
コード例 #2
0
ファイル: test.py プロジェクト: gappleto97/Senior-Project
 testBounty(('8.8.8.8',8888),"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",-1440,"Malformed bounty 6 (reward failure)")
 testBounty(('8.8.8.8',8888),"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",0,"Malformed bounty 7 (signature failure)")
 testBounty(('8.8.8.8',8888),"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",1440,"Correctly formed bounty 2", data={'reqs':{("__builtin__","pow",2,2):4}})
 testBounty(('8.8.8.8',8888),"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",1440,"Malformed bounty 8 (requirements failure)", data={'reqs':{("sys","platform","index=2","end=3"):"win33"}})
 testBounty(('8.8.8.8',8888),"1JTGcHS3GMhBGLcFRuHLk6Gww4ZEDmP7u9",1440,"Malformed bounty 9 (requirements failure)", data={'reqs':{("__builtin__","pow",2,2):4,("sys","platform"):"win33"}})
 safeprint("Malformed bounty 11 (timeout error)")
 safeprint(addBounty(pickle.dumps(bounty.Bounty(('8.8.8.8',8888),"1LhPsd4ng3AXmVPzrLWprWFx351pW4HJm8",10900,timeout=1),0)))
 testBounty(('8.8.8.8',8888),"1LhPsd4ng3AXmVPzrLWprWFx351pW4HJm8",10900,"Correctly formed bounty 3")
 testBounty(('8.8.8.8',8888),"1MWSdYMKEpfWVxC6BGYARxsksaQuyEWzG5",1480,"Correctly formed bounty 4")
 testBounty(('8.8.8.8',8888),"1EgGfDetymjMzcQ1AEhHjHEyXHjnEavwgg",10290,"Correctly formed bounty 5")
 safeprint(bounty.getBountyList())
 bounty.saveToFile()
 bounty.loadFromFile()
 safeprint(bounty.getBountyList())
 safeprint("3 bounties should follow")
 safeprint(bounty.getBounty(settings.config.get('charity'),settings.config.get('propagate_factor')))
 safeprint(bounty.getBounty(False,2))
 safeprint(bounty.getBounty(True,2))
 settings.saveSettings()
 settings.loadSettings()
 saveToFile()
 getFromFile()
 if not (sys.version_info[0] < 3 and sys.platform == "win32"):
     safeprint("Test listener begin")
     v = Value('b',True)
     q = Queue()
     a = Process(target=waitForty,args=(v,q))
     a.start()
     listen(44566,False,q,v,False)
 from common.call import call
 safeprint(call("random","random"))
コード例 #3
0
                           "1LhPsd4ng3AXmVPzrLWprWFx351pW4HJm8",
                           10900,
                           timeout=1), 0)))
 testBounty(('8.8.8.8', 8888), "1LhPsd4ng3AXmVPzrLWprWFx351pW4HJm8", 10900,
            "Correctly formed bounty 2")
 testBounty(('8.8.8.8', 8888), "1MWSdYMKEpfWVxC6BGYARxsksaQuyEWzG5", 1480,
            "Correctly formed bounty 3")
 testBounty(('8.8.8.8', 8888), "1EgGfDetymjMzcQ1AEhHjHEyXHjnEavwgg", 10290,
            "Correctly formed bounty 4")
 safeprint(bounty.getBountyList())
 bounty.saveToFile()
 bounty.loadFromFile()
 safeprint(bounty.getBountyList())
 safeprint("3 bounties should follow")
 safeprint(
     bounty.getBounty(settings.config.get('charity'),
                      settings.config.get('propagate_factor')))
 safeprint(bounty.getBounty(False, 2))
 safeprint(bounty.getBounty(True, 2))
 settings.saveSettings()
 settings.loadSettings()
 saveToFile()
 getFromFile()
 if not (sys.version_info[0] < 3 and sys.platform == "win32"):
     safeprint("Test listener begin")
     v = Value('b', True)
     q = Queue()
     a = Process(target=waitForty, args=(v, q))
     a.start()
     listen(44566, False, q, v, False)
 from common.call import call
 safeprint(call("random", "random"))