Exemple #1
0
import os

sys.path.append( "../" )

import iftproto
import iftfile
import protocols
import protocols.http
import hashlib
import threading
import time

import test_setup
import test_cleanup

test_setup.setup()

filename = "/home/jude/raven/tools/iftd/test/testfile.original"

class starter(threading.Thread):
        def __init__(self, transmitter):
                threading.Thread.__init__(self)
                self.transmitter = transmitter

        def run(self):
                time.sleep(0.01)
                print "starting"
                self.transmitter.state = iftproto.PROTO_STATE_RUNNING


sender = protocols.http.http_sender()
Exemple #2
0
"""
Nelly Kane
"""
import pathlib
filepath = pathlib.Path(__file__).parent.absolute()

import os
import sys

sys.path.append(os.path.join(filepath, '..'))
from test_setup import setup
setup()
from track import TargetTracker
import numpy as np

sys.path.append(os.path.join(sys.path[0], '..', '..', 'Src', 'Tracking'))
sys.path.append(os.path.join(sys.path[0], '..', '..', 'Src', 'Utilities'))

# tests pass function
tol = 1e-6


def test(name: str, passed: bool):
    print('Function: ' + name)
    if (passed == True):
        print('PASSED')
    else:
        print('FAILED')


trackerObj = TargetTracker(gateSize=5, distToDVec=5)
Exemple #3
0
MODULE_NAME = sys.argv[1]
FAILED_TESTS_COUNT = 0

for test_binary_file in glob.glob('*.out'):

    def log(msg):
        test_log('Testing {}... {}'.format(test_binary_file, msg))

    log('')

    ddfs_dir = tempfile.mkdtemp()
    ddfs_img = tempfile.mktemp()

    ret = test_setup.setup(module_name=MODULE_NAME,
                           ddfs_dir=ddfs_dir,
                           ddfs_img=ddfs_img)
    if ret == 0:
        log('TEST SETUP SUCCESS')
    else:
        log('TEST SETUP FAILED')
        FAILED_TESTS_COUNT += 1
        os.remove(ddfs_dir)
        os.remove(ddfs_img)
        continue

    passed = True

    try:
        log('Running test...')
        subprocess.run('./{} {}'.format(test_binary_file, ddfs_dir),
Exemple #4
0
import unittest
import test_setup

class TestsBase(unittest.TestCase):
    pass

class TestJSON(TestsBase):


    def test_upper(self):
        self.assertEqual('foo'.upper(), 'FOO')

    def test_isupper(self):
        self.assertTrue('FOO'.isupper())
        self.assertFalse('Foo'.isupper())

    def test_split(self):
        s = 'hello world'
        self.assertEqual(s.split(), ['hello', 'world'])
        # check that s.split fails when the separator is not a string
        with self.assertRaises(TypeError):
            s.split(2)

if __name__ == '__main__':
    test_setup.setup()
    unittest.main()
# -*- encoding: UTF8 -*-

__author__ = 'Christian Simon'

# init env
from test_setup import setup
setup()

import unittest
from webapp_discover.explorer import Explorer

expl = Explorer()

class FileTreeLengths(unittest.TestCase):
    """Testing the length of FileTree"""

    def setUp(self):
        self.path = self.init_tempdir()

    def tearDown(self):
        pass

    def init_tempdir(self):
        pass

    def test_recurse_inf(self):
        pass

    def test_recurse_zero(self):
        pass