Example #1
0
    def test_build_hydra(self):
        """"""
        print_bar('MiniHydra test start')

        hydra = MiniHydra(target='http://127.0.0.1:5000/auth',
                          mod='testmod',
                          dict_file=None,
                          session='default',
                          do_continue=False,
                          debug=False)
        gen = hydra.start(async=True)
        self.assertTrue(isinstance(gen, types.GeneratorType))
Example #2
0
  Author:   --<v1ll4n>
  Purpose: 
  Created: 02/24/17
"""

import unittest

from g3ar import DictParser
from g3ar.utils.print_utils import print_bar

dparser = DictParser(filename='demodict', session_id='demosession')

#
# First 10 LINE
#
print_bar('GET 10 LINES')
for i in xrange(10):
    print(dparser.next())
print_bar('END')
print()

dparser.force_save()

del dparser

dparser_continue = DictParser(filename='demodict',
                              session_id='demosession',
                              do_continue=True)
#
# Next Lines
#
Example #3
0
# example for taskbulter
#
import time
from g3ar import TaskBulter
from g3ar.utils.print_utils import print_bar

tbr = TaskBulter()

taskid = 'testtask-id'


#----------------------------------------------------------------------
def func(arg1, arg2='1'):
    """"""
    time.sleep(2)
    return arg1, arg2


print_bar('start the task')
print(tbr.start_task(id=taskid, target=func, args=('arg1var', )))

print_bar('watch the status')
print(tbr.get_tasks_status())

time.sleep(3)

print_bar('get result')
print(tbr.get_result(taskid))

if __name__ == '__main__':
    unittest.main()
Example #4
0
    def test_mod_manager(self):
        """"""
        print_bar('ModManager Test')

        print ModManager.get_mod_list()
        print ModManager.get_mod('testmod')