Пример #1
0
def form():
    form = MainForm()
    if form.validate_on_submit():
        passed, score, results = all_tests(form.text.data.lower())
        return render_template('results.html', results=results, passed=passed)
    else:
        return render_template('form.html', form=form)
Пример #2
0
def form():
    form = MainForm()
    if form.validate_on_submit():
        passed, score, results = all_tests(form.text.data.lower())
        return render_template('results.html', results = results, passed = passed)
    else:
        return render_template('form.html', form=form)
Пример #3
0
def main():

    parser = argparse.ArgumentParser()
    parser.add_argument("ucode", type=argparse.FileType("r"))
    parser.add_argument("-m", "--memsz", type=int, default=16 * 1024)
    parser.add_argument("-v",
                        "--verbose",
                        help="increase output verbosity",
                        action="store_true")

    args = parser.parse_args()
    if args.verbose:
        logging.basicConfig(level=logging.DEBUG)

    microcode = args.ucode.read()
    microstore = ustore.build_ustore(hardware.CPU, microcode)
    print("[+] Loaded %d microstore entries." % len(microstore))

    tests.all_tests(microstore, args.memsz)
Пример #4
0
#!/usr/bin/env python

import unittest
from tests import all_tests

if __name__ == "__main__":
    tests = all_tests()
    results = unittest.TextTestRunner().run(tests)


Пример #5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=================
Running all tests
=================

To have a fine grained control over the tests to run, you may use with Python
2.7 and later::

  python -m unittest -h

If you have unittest2, use the ``unit2`` command instead::

  unit2 -h
"""
import sys
if sys.version_info < (2, 7):
    import unittest2 as unittest
else:
    import unittest
from tests import all_tests

unittest.TextTestRunner(verbosity=2).run(all_tests())
Пример #6
0
        l = len(cmd)
        if(l == 2):
            filter_type(storage, cmd[1])
            ui_list(storage)
        if(l == 3):
            filter(storage, cmd[1], int(cmd[2]))
            ui_list(storage)
        add_stack(stack, storage)
        ui_menu1()
    if(cmd[0] == "undo"):
        storage.clear()
        storage.update(undo(stack,storage))
        ui_menu1()

################################################################################       
#********************************* main_function *********************************
################################################################################

if __name__ == "__main__":
    stack = []
    storage = {}
    create_storage(storage)
    stack.append(copy.deepcopy(storage))
    all_tests()
    a = int(input("continue with menu interface?\nPress 1 for 'yes' or 0 for 'no'\n"))
    if( a == 0):
        ui_menu()
    else:
        ui_menu1()
    
Пример #7
0
def test( test, avatar ):
    tests = all_tests()
    return unittest.TextTestRunner().run(tests)
Пример #8
0
import unittest
from tests import all_tests


if __name__ == "__main__":
    tests = all_tests()
    results = unittest.TextTestRunner().run(tests)
Пример #9
0
    files = io.command_line_args(sys.argv)
    polygon_file, points_file = files[0], files[1]

    # Read csv
    pl1 = io.read_csv(polygon_file,
                      'polygon',
                      name='Poly1',
                      trans_options=True)
    ps1 = io.read_csv(points_file, 'points', trans_options=True)

    # Transform options allows user to transform geometries
    geometries = io.transform_options(ps1, pl1)
    ps1, pl1 = geometries[0], geometries[1]

    # Tests
    test.all_tests(ps1, pl1)

    # Write the result of each point in a csv file
    io.write_csv(ps1, 'output.csv', state=True)

    # Plotting
    boundary_points = [p for p in ps1 if p.get_state() == 'boundary']
    inside_points = [p for p in ps1 if p.get_state() == 'inside']
    outside_points = [p for p in ps1 if p.get_state() == 'outside']

    plot = plt.Plotter()
    plot.add_polygon(pl1.all_x(), pl1.all_y())
    plot.add_point([p.get_x() for p in boundary_points],
                   [p.get_y() for p in boundary_points], 'boundary')
    plot.add_point([p.get_x() for p in inside_points],
                   [p.get_y() for p in inside_points], 'inside')
Пример #10
0
def test(test, avatar):
    tests = all_tests()
    return unittest.TextTestRunner().run(tests)