Esempio n. 1
0
 def __init__(self, method='runTest'):
     TestCase.__init__(self, method)
     self.method = method
     self.pdb_script = None
     self.fnull = None
     self.debugger = None
     self.netbeans_port = 3219
Esempio n. 2
0
	def __init__(self, *args, **kwargs):
		wsgiapp = pylons.test.pylonsapp
		config = wsgiapp.config
		self.app = PatchedTestApp(wsgiapp)
		app_globals._push_object(config['pylons.app_globals'])
		url._push_object(URLGenerator(config['routes.map'], environ))
		TestCase.__init__(self, *args, **kwargs)
Esempio n. 3
0
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)

        containers = (
            ResultContainer(
                linter='foo',
                path='a/b/c.txt',
                message="oh no foo",
                lineno=1,
            ),
            ResultContainer(
                linter='bar',
                path='d/e/f.txt',
                message="oh no bar",
                hint="try baz instead",
                level='warning',
                lineno=4,
                column=2,
                rule="bar-not-allowed",
            ),
            ResultContainer(
                linter='baz',
                path='a/b/c.txt',
                message="oh no baz",
                lineno=4,
                source="if baz:",
            ),
        )

        self.results = defaultdict(list)
        for c in containers:
            self.results[c.path].append(c)
Esempio n. 4
0
 def __init__(self, *args, **kwargs):
     if pylons.test.pylonsapp:
         wsgiapp = pylons.test.pylonsapp
     else:
         wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
     self.app = paste.fixture.TestApp(wsgiapp)
     TestCase.__init__(self, *args, **kwargs)
Esempio n. 5
0
 def __init__(self, methodName='runTest'):
     # Must call super class init to properly initialize unittest class
     TestCase.__init__(self, methodName)
     #
     # initialize colors and reporter properly if executed from Main
     if Verifier.__execFromMain:
         # enable color (unless nocolors) and summary report
         if not Verifier.__nocolors:
             Verifier.COLORS = color.colors
         if Verifier.reporter is None:
             # make reporter static so that it remains across runs
             Verifier.reporter = TestReporter(self.COLORS)
         #
         # copy to this instance
         self.reporter = Verifier.reporter
     #
     # Protected variables are set per run to facilitate test-harness methods.
     self._dir = None
     self._testSM = None
     self._smApp = None
     self._dontSendQuit = False  # used in rare cases to NOT send 'quit'
     self._preserveImpl = False
     self._subdirsToClean = []
     self._keepGen = False
     self._useSimStateStart = False
     self._enableGui = False
     self._verbose = False
     self._suiteVersion = None
Esempio n. 6
0
    def __init__(self, methodName):
        """
        Class constructor. Starts a Changes class for use in other tests.
        """
        TestCase.__init__(self, methodName)

        self.changes = Changes(filename='debexpo/tests/changes/synce-hal_0.1-1_source.changes')
Esempio n. 7
0
 def __init__(self, *args, **kwargs):
     if pylons.test.pylonsapp:
         wsgiapp = pylons.test.pylonsapp
     else:
         wsgiapp = loadapp('config:%s' % config['__file__'])
     self.app = TestApp(wsgiapp)
     TestCase.__init__(self, *args, **kwargs)
Esempio n. 8
0
 def __init__(self, *args, **kwargs):
     """ TestController init """
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.config
     self.app = TestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
Esempio n. 9
0
    def __init__(self, *args, **kwargs):
        '''
        initialize the test class
        '''
        TestCase.__init__(self, *args, **kwargs)

        LOG.error("ConfigFile: %s " % config['__file__'])

        conffile = config['__file__']

        if pylons.test.pylonsapp:
            wsgiapp = pylons.test.pylonsapp
        else:
            wsgiapp = loadapp('config: %s' % config['__file__'])

        self.app = TestApp(wsgiapp)

        conf = None
        if conffile.startswith('/'):
            conf = appconfig('config:%s' % config['__file__'], relative_to=None)
        else:
            raise Exception('dont know how to load the application relatively')
        #conf = appconfig('config: %s' % config['__file__'], relative_to=rel)

        load_environment(conf.global_conf, conf.local_conf)
        self.appconf = conf

        url._push_object(URLGenerator(config['routes.map'], environ))

        self.isSelfTest = False
        if env.has_key("privacyidea.selfTest"):
            self.isSelfTest = True

        self.license = 'CE'
        return
Esempio n. 10
0
 def __init__(self, *args, **kwargs):
     
     TestCase.__init__(self, *args, **kwargs)        
     self.TEMPLATE_TESTS_PACKAGE = Parameter()
     self.tweak()        
     self.test_folder = os.path.dirname(
         self.TEMPLATE_TESTS_PACKAGE.__file__)
     self.system = Templates(self.test_folder)
Esempio n. 11
0
    def __init__(self, *args, **kwargs):
        wsgiapp = pylons.test.pylonsapp
        config = wsgiapp.config
        self.app = TestApp(wsgiapp)
        url._push_object(URLGenerator(config['routes.map'], environ))
        TestCase.__init__(self, *args, **kwargs)

        self.pkey, self.cert = _generate_mock_cert()
Esempio n. 12
0
 def __init__(self, *args, **kwargs):
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.config
     self.app = webtest.TestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     self.__setattrs__()
     self.__setcreateparams__()
     TestCase.__init__(self, *args, **kwargs)
Esempio n. 13
0
 def __init__(self, *args, **kwargs):
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.config
     self.app = OptionsTestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
     self.from_date = datetime(1990,1,1).isoformat() + "Z"
     self.controllerName = None
Esempio n. 14
0
 def __init__(self, *args, **kwargs):
     if pylons.test.pylonsapp:
         wsgiapp = pylons.test.pylonsapp
     else:
         wsgiapp = loadapp('config:%s' % config['__file__'])
     self.app = TestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
Esempio n. 15
0
 def __init__(self, *args, **kwargs):
     
     TestCase.__init__(self, *args, **kwargs)        
     config = dict(
         Templates=Section(
             TEMPLATE_FOLDER="path://tests.templates.templates"
         ))
     self.system = Templates(config)
Esempio n. 16
0
 def __init__(self, *args, **kwargs):
     if pylons.test.pylonsapp:
         wsgiapp = pylons.test.pylonsapp
     else:
         wsgiapp = loadapp('config:%s' % config['__file__'])
     self.app = TestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
Esempio n. 17
0
    def __init__(self, *args, **kwargs):
        self.authz_file = os.path.dirname(__file__) + '/../../config/svn.access.test'

        wsgiapp = pylons.test.pylonsapp
        config = wsgiapp.config
        self.app = TestApp(wsgiapp)
        url._push_object(URLGenerator(config['routes.map'], environ))
        TestCase.__init__(self, *args, **kwargs)
Esempio n. 18
0
 def __init__(self, *args, **kwargs):
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.config
     self.app = TestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
     self.from_date = datetime(1990,1,1).isoformat()+ "Z" 
     self.until_date = datetime.utcnow().isoformat()+ "Z" 
Esempio n. 19
0
    def __init__(self, fieldnames, data_generators):

        TestCase.__init__(self)

        self._data_generators = list(chain((lambda: self._serial_number, time), data_generators))
        self._fieldnames = list(chain(('_serial', '_time'), fieldnames))
        self._recorder = TestRecorder(self)
        self._serial_number = None
Esempio n. 20
0
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)

        self.backend = None
        self.weboob = Weboob()

        if self.weboob.load_backends(modules=[self.BACKEND]):
            self.backend = choice(self.weboob.backend_instances.values())
Esempio n. 21
0
 def __init__(self, *args, **kwargs):
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.application.config
     self.config = config
     self.app = TestApp(wsgiapp)
     self.g = self.config['pylons.app_globals']
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
Esempio n. 22
0
File: test.py Progetto: 2uinc/boto
 def __init__(self, *args, **kw):
     TestCase.__init__(self, *args, **kw)
     self.fps = FPSConnection(host='fps.sandbox.amazonaws.com')
     if advanced:
         self.activity = self.fps.get_account_activity(\
                             StartDate='2012-01-01')
         result = self.activity.GetAccountActivityResult
         self.transactions = result.Transaction
Esempio n. 23
0
    def __init__(self, methodName, root_dir=None):
        TestDvcFixture.__init__(self, root_dir)
        TestCase.__init__(self, methodName)

        self.pkg_dir = os.path.join(self._root_dir, self.GIT_PKG)
        cache_dir = os.path.join(self._root_dir, self.CACHE_DIR)
        self.pkg_fixture = TestDvcDataFileFixture(root_dir=self.pkg_dir,
                                                  cache_dir=cache_dir)
        self.pkg_fixture.setUp()
Esempio n. 24
0
    def __init__(self, test_func):
        """Create a document change test.

        `self` is this test case.
        `test_func` is the test function to run.

        """
        TestCase.__init__(self, test_func)
        self._fixture = _WorkDirFixture()
Esempio n. 25
0
    def __init__(self, *args, **kwargs):
        wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
        self.app = wsgiapp
        from twirlip.lib.notification import notification_methods
        notification_methods['Email'] = mock_email

        httplib2_intercept.install()
        add_wsgi_intercept('testserver.example.com', 80, TwirlipServerFixture)
        TestCase.__init__(self, *args, **kwargs)
Esempio n. 26
0
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)

        filedir = os.path.join(here, "files")
        self.files = [os.path.join(filedir, f) for f in os.listdir(filedir)]
        self.lintdir = os.path.join(here, "linters")

        names = ("string.lint", "regex.lint", "external.lint")
        self.linters = [os.path.join(self.lintdir, n) for n in names]
Esempio n. 27
0
 def __init__(self, core, client, ignore=None):
     TestCase.__init__(self)
     self.core = core
     self.core.logger = CapturingLogger()
     self.client = client
     if ignore is None:
         self.ignore = dict()
     else:
         self.ignore = ignore
Esempio n. 28
0
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)

        self.filedir = os.path.join(here, 'files')
        self.files = [os.path.join(self.filedir, f) for f in os.listdir(self.filedir)]
        self.lintdir = os.path.join(here, 'linters')

        names = ('string.lint', 'regex.lint', 'external.lint')
        self.linters = [os.path.join(self.lintdir, n) for n in names]
Esempio n. 29
0
 def __init__(self, core, client, ignore=None):
     TestCase.__init__(self)
     self.core = core
     self.core.logger = CapturingLogger()
     self.client = client
     if ignore is None:
         self.ignore = dict()
     else:
         self.ignore = ignore
Esempio n. 30
0
    def __init__(self, *args, **kwargs):
        wsgiapp = pylons.test.pylonsapp
        config = wsgiapp.config

        self.app = TestApp(wsgiapp)
        url._push_object(URLGenerator(config['routes.map'], environ))
        self.Session = Session
        self.index_location = config['app_conf']['index_dir']
        TestCase.__init__(self, *args, **kwargs)
Esempio n. 31
0
    def __init__(self, *args, **kwargs):
        wsgiapp = pylons.test.pylonsapp
        config = wsgiapp.config

        self.app = TestApp(wsgiapp)
        url._push_object(URLGenerator(config['routes.map'], environ))
        self.Session = Session
        self.index_location = config['app_conf']['index_dir']
        TestCase.__init__(self, *args, **kwargs)
Esempio n. 32
0
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)

        self.filedir = os.path.join(here, 'files')
        self.files = [os.path.join(self.filedir, f) for f in os.listdir(self.filedir)]
        self.lintdir = os.path.join(here, 'linters')

        names = ('string.lint', 'regex.lint', 'external.lint')
        self.linters = [os.path.join(self.lintdir, n) for n in names]
Esempio n. 33
0
    def __init__(self, *args, **kwargs):
        self.yadisk = None

        TestCase.__init__(self, *args, **kwargs)

        self.yadisk = yadisk_async.YaDisk(os.environ.get("PYTHON_YADISK_APP_ID"),
                                          os.environ.get("PYTHON_YADISK_APP_SECRET"),
                                          os.environ.get("PYTHON_YADISK_APP_TOKEN"))

        self.path = os.environ.get("PYTHON_YADISK_TEST_ROOT")
Esempio n. 34
0
 def __init__(self, eztest, method_name='runTest'):
     TestCase.__init__(self, method_name)
     self.eztest = eztest
     self.page = None
     self.driver = None
     self.base_url = 'http://localhost:5000'
     self.wait_time = 1  # Default
     self.name = self.__class__.NAME
     self.fixture = self.__class__.FIXTURE
     self.expected_models = dict()
Esempio n. 35
0
 def __init__(self, *args, **kwargs):
     TestCase.__init__(self, *args, **kwargs)
     monitor_plugin = 'kubejobs'
     database_data = {
         "url": "http://localhost/",
         "port": 12345,
         "name": "test"
     }
     app_id = "1"
     self.influx = InfluxDataSource(monitor_plugin, database_data, app_id)
Esempio n. 36
0
 def __init__(self, methodName='runTest'):
     TestCase.__init__(self, methodName)
     # Get bundle and channel info for framework initialization.
     self.bundle_directory = bootstrap.bundle_directory
     self.config = bootstrap.config
     self.framework_directory = bootstrap.framework_directory
     # Autodetect module name if not defined explicitly.
     if self.module_name is None:
         self.module_name = self.__module__
         if self.module_name[-5:] == '_test':
             self.module_name = self.module_name[:-5]
Esempio n. 37
0
 def __init__(self, profile, ydk_root, test_cases_root, groupings_as_class,
              language='python'):
     self.profile = profile
     self.ydk_root = ydk_root
     self.test_cases_root = test_cases_root
     self.groupings_as_class = groupings_as_class
     self.language = language
     setattr(self, self.language + " Gen", self.translate_and_check)
     self.actual_dir = self.test_cases_root + '/' + self.language + '/actual'
     self.expected_dir = self.test_cases_root + '/' + self.language + '/expected'
     TestCase.__init__(self, self.language + " Gen")
Esempio n. 38
0
 def __init__(self, *args, **kwds):
     TestCase.__init__(self, *args, **kwds)
     self.project = None
     self.r1 = None
     self.r2 = None
     self.r3 = None
     self.r4 = None
     self.r5 = None
     self.r6 = None
     self.r7 = None
     self.r8 = None
Esempio n. 39
0
 def __init__(self, *args, **kwargs):
     TestCase.__init__(self, *args, **kwargs)
     self.immutables = [
         True, False, None, 7357, 42, (True, 69), (1337, ()), '\n +  \t',
         'test',
         frozenset([1, "a", "\n"]),
         frozenset([1, ('r', 2), "a", "\n"])
     ]
     self.db_path = 'tests'
     self.db_name = 'general_test_base'
     self.full_db_path = self.db_path + '\\' + self.db_name
Esempio n. 40
0
 def __init__(self, *args, **kwds):
     TestCase.__init__(self, *args, **kwds)
     self.project = None
     self.r1 = None
     self.r2 = None
     self.r3 = None
     self.r4 = None
     self.r5 = None
     self.r6 = None
     self.r7 = None
     self.r8 = None
Esempio n. 41
0
 def __init__(self, *args, **kw):
     TestCase.__init__(self, *args, **kw)
     try:
         app = self.app
     except AttributeError:
         name= '.'.join([self.__class__.__module__,  self.__class__.__name__])
         raise AttributeError("You need to place the wsgi app to test at ""%s's 'app' attribute" % name)
     if not isinstance(app, TestApp):
         self.app = TestApp(app)
     else:
         self.app = app
    def __init__(self, name):
        TestCase.__init__(self, name)

        self.commands = find_commands("test/cmds/")

        self.auth = AuthManager("test/etc/users.auth")
        self.commander = Commander(self.auth)

        self.scanner = MailScanner(Parsers(self.commands))
        self.email = UnicodeParser().parse(open("test/data/cmd.email"))

        self.notifier = EmailNotifier("10.2.1.2", 25)
 def __init__(self, *args, **kwargs):
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.config
     self.app = OptionsTestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
     self.from_date = datetime(1990,1,1).isoformat() + "Z"
     self.controllerName = None
     def get_wsgiapp():
         return wsgiapp
     wsgi_intercept.add_wsgi_intercept('localhost', 80, get_wsgiapp)
     wsgi_intercept.add_wsgi_intercept('127.0.0.1', 80, get_wsgiapp)
Esempio n. 44
0
    def __init__(self, test_function, test_input, override_method_name, target,
                 override_module, *args, **kwargs):
        self.test_function = test_function
        self.test_input = test_input
        self.target = target
        self.args = args
        self.kwargs = kwargs

        self.__class__.__module__ = do_module_override(
            override_module, self.__class__.__module__)
        self.execute_method_override(override_method_name)

        TestCase.__init__(self, methodName=override_method_name)
Esempio n. 45
0
    def __init__(self, *args, **kwargs):
        wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
        config = wsgiapp.config
        pylons.app_globals._push_object(config['pylons.app_globals'])
        pylons.config._push_object(config)

        # Initialize a translator for tests that utilize i18n
        translator = _get_translator(pylons.config.get('lang'))
        pylons.translator._push_object(translator)

        url._push_object(URLGenerator(config['routes.map'], environ))
        self.app = TestApp(wsgiapp)
        TestCase.__init__(self, *args, **kwargs)
Esempio n. 46
0
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)
        alibabacloud.utils._test_flag = True
        if sys.version_info[0] == 2:
            self.assertRegex = self.assertRegexpMatches

        self._sdk_config = self._init_sdk_config()
        self.access_key_id = self._read_key_from_env_or_config("ACCESS_KEY_ID")
        self.access_key_secret = self._read_key_from_env_or_config(
            "ACCESS_KEY_SECRET")
        self.region_id = self._read_key_from_env_or_config("REGION_ID")
        self.client = self._init_client()
        self.ecs = self._get_ecs_resource()
Esempio n. 47
0
    def __init__(self, libname, funcname, setup, teardown):
        self.funcname = funcname
        self.libname = libname
        self.setupname = setup
        self.teardownname = teardown
        self.expected = 0
        if funcname.endswith("expect_fail"):
            self.expected = 1
        elif funcname.endswith("expect_err"):
            self.expected = 2

        TestCase.__init__(self)
        self._testMethodDoc = '%s:%s' % (libname.split('/')[-1], funcname)
Esempio n. 48
0
 def __init__(self):
     TestCase.__init__(self)
     self.divid = document.currentDiv()
     self.mydiv = document.getElementById(self.divid)
     res = document.getElementById(self.divid + '_unit_results')
     if res:
         self.resdiv = res
         res.innerHTML = ''
     else:
         self.resdiv = document.createElement('div')
         self.resdiv.setAttribute('id', self.divid + '_unit_results')
         self.resdiv.setAttribute('class', 'unittest-results')
         self.mydiv.appendChild(self.resdiv)
Esempio n. 49
0
 def __init__(self, profile, ydk_root, groupings_as_class, generate_tests,
              test_cases_root, aug_base, aug_contrib, aug_compare):
     self.profile = profile
     self.ydk_root = ydk_root
     self.groupings_as_class = groupings_as_class
     self.generate_tests = generate_tests
     self.test_cases_root = test_cases_root
     self.aug_base = aug_base
     self.aug_contrib = aug_contrib
     self.aug_compare = aug_compare
     setattr(self, 'python' + " Patch", self.translate_and_check)
     TestCase.__init__(self, 'python' + " Patch")
     self.actual_dir = self.test_cases_root + '/python/actual/bundle_aug'
     self.expected_dir = self.test_cases_root + '/python/expected/bundle_aug'
Esempio n. 50
0
 def __init__(self, *args, **kw):
     try:
         pkg_resources.require(*self.require)
     except pkg_resources.DistributionNotFound:
         name = ':'.join([self.__class__.__module__, self.__class__.__name__])
         reqs = self.require
         self._message_displayed = False
         def dummy_run(self, result=None):
             if not self._message_displayed:
                 print >> sys.stderr, "Skipping all tests in %s due to missing " \
                                      "requirements: %r" % (name, reqs)
                 self._message_displayed = True
         self.run = instancemethod(dummy_run, self, self.__class__)
     TestCase.__init__(self, *args, **kw)
Esempio n. 51
0
    def __init__(self, *args, **kwargs):
        wsgiapp = pylons.test.pylonsapp
        config = wsgiapp.config
        self.app = OptionsTestApp(wsgiapp)
        url._push_object(URLGenerator(config['routes.map'], environ))
        TestCase.__init__(self, *args, **kwargs)
        self.from_date = datetime(1990, 1, 1).isoformat() + "Z"
        self.controllerName = None

        def get_wsgiapp():
            return wsgiapp

        wsgi_intercept.add_wsgi_intercept('localhost', 80, get_wsgiapp)
        wsgi_intercept.add_wsgi_intercept('127.0.0.1', 80, get_wsgiapp)
Esempio n. 52
0
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)

        self.backends = {}
        self.backend_instance = None
        self.backend = None
        self.weboob = Weboob()

        if self.weboob.load_backends(modules=[self.BACKEND]):
            # provide the tests with all available backends
            self.backends = self.weboob.backend_instances
            # chose one backend (enough for most tests)
            self.backend_instance = choice(self.backends.keys())
            self.backend = self.backends[self.backend_instance]
Esempio n. 53
0
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)

        self.backends = {}
        self.backend_instance = None
        self.backend = None
        self.weboob = Weboob()

        # Skip tests when passwords are missing
        self.weboob.requests.register('login', self.login_cb)

        if self.weboob.load_backends(modules=[self.MODULE]):
            # provide the tests with all available backends
            self.backends = self.weboob.backend_instances
Esempio n. 54
0
    def __init__(self, x):
        TestCase.__init__(self, x)
        host = "127.0.0.1"
        port = 5000
        prefix = "arakoon/test_etcd/"
        self._root = '/'.join([X.tmpDir, 'arakoon_system_tests', 'test_etcd'])
        self._etcd_home = '%s/%s' % (self._root, 'etcd_server')
        self._server = EtcdServer(self._etcd_home, host, port, prefix)
        self._etcdClient = EtcdClient([(host, port)], prefix)
        self._cluster_id = "etcd_based_cluster"
        self._arakoon_port = 4000
        self._nodes = ['etcd_ara0']

        ConfigParser.ConfigParser()
Esempio n. 55
0
    def __init__(self, methodName=None):
        TestCase.__init__(self, methodName=methodName)
        self.start_time = 0

        self.logger = logging.getLogger('APITestBase')  
        self.logger.setLevel(logging.INFO) 
          
        fh = logging.FileHandler('tablestore_sdk_test.log')  
        fh.setLevel(logging.INFO)  
          
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')  
        fh.setFormatter(formatter)  
          
        self.logger.addHandler(fh)  
Esempio n. 56
0
File: gui.py Progetto: soney/skulpt
 def __init__(self):
     TestCase.__init__(self)
     self.closestDiv = document.currentDiv()
     self.divid = document.currentGradingContainer()
     self.mydiv = document.getElementById(self.divid)
     res = document.getElementById(self.divid + "_unit_results")
     if res:
         self.resdiv = res
         res.innerHTML = ""
     else:
         self.resdiv = document.createElement("div")
         self.resdiv.setAttribute("id", self.divid + "_unit_results")
         self.resdiv.setAttribute("class", "unittest-results")
         self.mydiv.appendChild(self.resdiv)
Esempio n. 57
0
    def __init__(self, *args, **kwargs):
        TC.__init__(self, *args, **kwargs)

        self.client = app.test_client()
        self.admin_id = 'fake_admin'
        self.student_id = 'fake_student'
        self.pw = 'fake'
        self.hashed_pw = hexlify(
            pbkdf2_hmac(
                hash_name='sha256',
                password=self.pw.encode(),
                salt=app.secret_key.encode(),
                iterations=100000
            )
        ).decode('utf-8')
Esempio n. 58
0
    def __init__(self, methodName='runTest', data=None, dataId=None):
        BaseTestCase.__init__(self, methodName)

        self.__data = data
        self.__dataId = dataId

        # wrapped the test method to allow to be called with data as arguments
        if None is not self.__data:
            self.__testMethod = getattr(self, methodName)

            functools.update_wrapper(
                self.__invokeWithData.__func__,
                self.__testMethod.__func__,
            )
            setattr(self, self._testMethodName, self.__invokeWithData)
Esempio n. 59
0
 def __init__(self,
              profile,
              ydk_root,
              test_cases_root,
              groupings_as_class,
              generate_tests,
              language='python'):
     self.profile = profile
     self.ydk_root = ydk_root
     self.test_cases_root = test_cases_root
     self.groupings_as_class = groupings_as_class
     self.generate_tests = generate_tests
     self.language = language
     setattr(self, self.language + " Gen", self.translate_and_check)
     self.actual_dir = self.test_cases_root + '/' + self.language + '/actual'
     self.expected_dir = self.test_cases_root + '/' + self.language + '/expected'
     TestCase.__init__(self, self.language + " Gen")