def __init__(self):
     Test.__init__(self, "DocumentFields")
     self.addTestFunction(self.createEmpty)
     self.addTestFunction(self.addField)
     self.addTestFunction(self.getEmptyField)
     self.addTestFunction(self.addMultipleFields)
     self.addTestFunction(self.setType)
Ejemplo n.º 2
0
 def __init__(self):
     Test.__init__(self, "Path")
     self.addTestFunction(self.createEmpty)
     self.addTestFunction(self.createLocal)
     self.addTestFunction(self.createAbsolute)
     self.addTestFunction(self.createNotClean)
     self.addTestFunction(self.createMultipleExtensions)
Ejemplo n.º 3
0
 def __init__(self):
     Test.__init__(self, "LatexNotes")
     self.addTestFunction(self.emptyContent)
     self.addTestFunction(self.titleContent)
     self.addTestFunction(self.descTableYear)
     self.addTestFunction(self.descTableAuthors)
     self.addTestFunction(self.descTableKeywords)
     self.addTestFunction(self.descTableJournal)
     self.addTestFunction(self.descTableAll)
Ejemplo n.º 4
0
 def __init__(self):
     Test.__init__(self, "Directory")
     d = Directory("dir")
     d.removeDir()
     self.addTestFunction(self.create)
     self.addTestFunction(self.remove)
     self.addTestFunction(self.createTree)
     self.addTestFunction(self.content)
     self.addTestFunction(self.containsFolder)
Ejemplo n.º 5
0
 def __init__(self):
     Test.__init__(self)
     self.title = title
     self.desc = desc
     self.vulnerability = vulnerability
     self.exploit = exploit
     self.countermeasure = countermeasure
     self.filename = splitext(basename(__file__))[0] + ".md"
     self.pre_run()
     self.run()
Ejemplo n.º 6
0
 def __init__(self):
     run(["pkill", "air*"], stdout=DEVNULL, stderr=DEVNULL)
     Test.__init__(self)
     self.title = title
     self.desc = desc
     self.vulnerability = vulnerability
     self.exploit = exploit
     self.countermeasure = countermeasure
     self.filename = splitext(basename(__file__))[0] + ".md"
     self.pre_run()
     self.run()
 def __init__(self):
     Test.__init__(self, "DocumentFolder")
     self.titles = ["document about  science",
                    "document: about \"science\"",
                    "document: about the \"science\" and the (internet)"]
     self.folderNames = ["document_about_science",
                         "document_about_science",
                         "document_about_science_internet"]
     self.addTestFunction(self.folderName)
     self.addTestFunction(self.create)
     self.addTestFunction(self.internFolders)
     self.addTestFunction(self.organize)
Ejemplo n.º 8
0
 def __init__(self):
     run(["pkill", "air*"], stdout=DEVNULL, stderr=DEVNULL)
     Test.__init__(self)
     self.title = title
     # To access the tmp_path variable
     self.desc = 'The board will try to disconnect clients from all detected WPA networks and capture the ' \
                 'four-way WPA/WPA2 handshake. Handshakes (pcap files) will be found in the [' + Test.tmp_path + \
                 '](' + Config.temp_dir + ') folder.'
     self.vulnerability = vulnerability
     self.exploit = exploit
     self.countermeasure = countermeasure
     self.filename = splitext(basename(__file__))[0] + ".md"
     self.pre_run()
     self.run()
Ejemplo n.º 9
0
 def __init__(self):
     Test.__init__(self)
     self.title = title
     self.desc = 'Display the IP address details assigned to the ' + Test.interface.name + ' interface via DHCP. ' \
                                                                                           'The IP address, ' \
                                                                                           'Subnet Mask, ' \
                                                                                           'Default Gateway and ' \
                                                                                           'DNS information are ' \
                                                                                           'listed.'
     self.vulnerability = vulnerability
     self.exploit = exploit
     self.countermeasure = countermeasure
     self.filename = splitext(basename(__file__))[0] + ".md"
     self.pre_run()
     self.run()
Ejemplo n.º 10
0
def pytest_generate_tests(metafunc):
    if metafunc.module.__name__.find('.test_api') == -1:
        return
    options = metafunc.config.option
    transport_urls = options.transport_urls.split(',')
    role_credentials = {}
    for role in USER_ROLES:
        refresh_token = getattr(options, '%s_refresh_token' % role, None)
        access_token = getattr(options, '%s_access_token' % role, None)
        login = getattr(options, '%s_login' % role, None)
        password = getattr(options, '%s_password' % role, None)

        if refresh_token:
            role_credentials[role] = {'refresh_token': refresh_token}
        elif access_token:
            role_credentials[role] = {'access_token': access_token}
        elif login and password:
            role_credentials[role] = {'login': login, 'password': password}

    tests = []
    ids = []
    for transport_url in transport_urls:
        for user_role, credentials in six.iteritems(role_credentials):
            tests.append(Test(transport_url, user_role, credentials))
            ids.append('%s:%s' % (user_role, transport_url))
    metafunc.parametrize('test', tests, ids=ids, indirect=['test'])
Ejemplo n.º 11
0
def pytest_generate_tests(metafunc):
    if metafunc.module.__name__.find('.test_api') == -1:
        return
    transport_urls = metafunc.config.option.transport_urls.split(',')
    refresh_token = metafunc.config.option.refresh_token
    tests = []
    ids = []
    for transport_url in transport_urls:
        tests.append(Test(transport_url, refresh_token))
        ids.append(transport_url)
    metafunc.parametrize('test', tests, ids=ids)
Ejemplo n.º 12
0
 def alimentar(self):
     """ Alimentar """
     super().alimentar()
     if self.alimentado == False:
         for insumos_ruta in self.directorios:
             self.listas.append(
                 Test(
                     insumos_ruta=insumos_ruta,
                     json_ruta=self.json_ruta_para_lista(insumos_ruta),
                     url_ruta_base=self.url_ruta_base_para_lista(
                         insumos_ruta),
                 ))
         # Ya está alimentado
         self.alimentado = True
Ejemplo n.º 13
0
def pytest_generate_tests(metafunc):
    if metafunc.module.__name__.find('.test_api') == -1:
        return
    options = metafunc.config.option
    transport_urls = options.transport_urls.split(',')
    role_credentials = {}
    for role in USER_ROLES:
        refresh_token = getattr(options, '%s_refresh_token' % role, None)
        access_token = getattr(options, '%s_access_token' % role, None)
        login = getattr(options, '%s_login' % role, None)
        password = getattr(options, '%s_password' % role, None)

        if refresh_token:
            role_credentials[role] = {'refresh_token': refresh_token}
        elif access_token:
            role_credentials[role] = {'access_token': access_token}
        elif login and password:
            role_credentials[role] = {'login': login, 'password': password}

    log_level = options.log_level or 'INFO'

    logger = logging.getLogger('devicehive')
    logger.setLevel(log_level)
    handler = logging.StreamHandler()
    formatter = logging.Formatter('[%(asctime)s] %(message)s',
                                  '%Y-%m-%d %H:%M:%S')
    handler.setFormatter(formatter)
    logger.addHandler(handler)

    tests = []
    ids = []
    for transport_url in transport_urls:
        for user_role, credentials in six.iteritems(role_credentials):
            tests.append(Test(transport_url, user_role, credentials))
            ids.append('%s:%s' % (user_role, transport_url))
    metafunc.parametrize('test', tests, ids=ids)
 def __init__(self):
     Test.__init__(self, "FieldsFormatting")
     self.addTestFunction(self.authors)
     self.addTestFunction(self.journal)
Ejemplo n.º 15
0
 def __init__(self):
     Test.__init__(self, "Document")
     self.addTestFunction(self.createFolderFromBibfile)
Ejemplo n.º 16
0
               help='Train network to learn IK')
p.add_argument('--infer',
               action='store_true',
               help='Run inference test on existing network model')
p.add_argument('--table',
               action='store_true',
               help='Produce table of determinant values')
p.add_argument('--ik',
               action='store_true',
               help='Run inverse kinematic test using sympy solver')

args = p.parse_args()

if args.test:
    from tests.test import Test
    Test().test()

if args.train:
    from src.train import Train
    Train().train()

if args.infer:
    from src.infer import Infer
    Infer().infer()

if args.table:
    from tests.table import Table
    Table().table()

if args.ik:
    from tests.ik import IK
Ejemplo n.º 17
0
from pyspark.conf import SparkConf
from BL.collaborative_filtering import CF
from BL.create_clusters import Cluster
from BL.prepare_data_spark import Data
from BL.content_base_filtering import CBF
from BL.NoCourses import NoCourses
from tests.test import Test

print("Starting create classes")

# creating classes
prep = Data()
cluster = Cluster()
cf = CF()
cbf = CBF()
test = Test()

no_courses = NoCourses()

print("Starting setup Spark")

conf = SparkConf()
conf.set('spark.logConf', app.config["SPARK_LOG_CONF"])
conf.set("spark.jars", app.config["MY_SQL_CONNECTOR_PATH"])

# Create Spark Session
spark = SparkSession.builder.appName("DecideForYou").config(
    conf=conf).master("local[2]").getOrCreate()
spark.sparkContext.setLogLevel("WARN")

print("Starting loading files")
Ejemplo n.º 18
0
 def __init__(self):
     Test.__init__(self, "BibParser")
     self.addTestFunction(self.writeBib)
     self.addTestFunction(self.parse)
Ejemplo n.º 19
0
 def __init__(self):
     Test.__init__(self, "File")
     self.addTestFunction(self.notExist)
     self.addTestFunction(self.create)
     self.addTestFunction(self.remove)
     self.addTestFunction(self.readWrite)