Exemplo n.º 1
0
    def run(self):
        # Set timezone in environment.
        os.environ['TZ'] = 'UTC'

        def set_config():
            from trytond.config import CONFIG
            CONFIG['db_type'] = 'postgresql'
            CONFIG['db_host'] = 'localhost'
            CONFIG['db_port'] = 5432
            CONFIG['db_user'] = '******'

        from trytond.backend.postgresql import Database
        import trytond.tests.test_tryton

        # Needed for the database loader to load correctly
        set_config()

        trytond.tests.test_tryton.DB_NAME = 'test_' + str(int(time.time()))
        from trytond.tests.test_tryton import DB_NAME
        trytond.tests.test_tryton.DB = Database(DB_NAME)
        from trytond.pool import Pool
        Pool.test = True
        trytond.tests.test_tryton.POOL = Pool(DB_NAME)

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 2
0
    def run(self):
        # Set timezone in environment.
        os.environ['TZ'] = 'UTC'

        def set_config():
            os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'

        from trytond.backend.postgresql import Database
        import trytond.tests.test_tryton

        # Needed for the database loader to load correctly
        set_config()

        trytond.tests.test_tryton.DB_NAME = 'test_' + str(int(time.time()))
        from trytond.tests.test_tryton import DB_NAME
        trytond.tests.test_tryton.DB = Database(DB_NAME)
        from trytond.pool import Pool
        Pool.test = True
        trytond.tests.test_tryton.POOL = Pool(DB_NAME)

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 3
0
    def run(self):
        # Set timezone in environment.
        os.environ['TZ'] = 'UTC'

        def set_config():
            from trytond.config import CONFIG
            CONFIG['db_type'] = 'postgresql'
            CONFIG['db_host'] = 'localhost'
            CONFIG['db_port'] = 5432
            CONFIG['db_user'] = '******'

        from trytond.backend.postgresql import Database
        import trytond.tests.test_tryton

        # Needed for the database loader to load correctly
        set_config()

        trytond.tests.test_tryton.DB_NAME = 'test_' + str(int(time.time()))
        from trytond.tests.test_tryton import DB_NAME
        trytond.tests.test_tryton.DB = Database(DB_NAME)
        from trytond.pool import Pool
        Pool.test = True
        trytond.tests.test_tryton.POOL = Pool(DB_NAME)

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 4
0
 def run(self):
     from openerp.tools import config
     config.options['db_user'] = '******'
     config.options['db_host'] = 'localhost'
     config.options['db_port'] = 5432
     from tests import suite
     unittest.TextTestRunner(verbosity=3).run(suite())
Exemplo n.º 5
0
    def run(self):
        from trytond.config import CONFIG
        CONFIG['db_type'] = 'postgresql'
        CONFIG['db_host'] = 'localhost'
        CONFIG['db_port'] = 5432
        CONFIG['db_user'] = '******'
        CONFIG['timezone'] = 'UTC'

        from trytond import backend
        import trytond.tests.test_tryton

        # Set the db_type again because test_tryton writes this to sqlite
        # again
        CONFIG['db_type'] = 'postgresql'

        trytond.tests.test_tryton.DB_NAME = 'test_' + str(int(time.time()))
        from trytond.tests.test_tryton import DB_NAME
        trytond.tests.test_tryton.DB = backend.get('Database')(DB_NAME)
        from trytond.pool import Pool
        Pool.test = True
        trytond.tests.test_tryton.POOL = Pool(DB_NAME)

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 6
0
    def run(self):
        from trytond.config import CONFIG
        CONFIG['db_type'] = 'postgresql'
        CONFIG['db_host'] = 'localhost'
        CONFIG['db_port'] = 5432
        CONFIG['db_user'] = '******'
        CONFIG['timezone'] = 'UTC'

        from trytond import backend
        import trytond.tests.test_tryton

        # Set the db_type again because test_tryton writes this to sqlite
        # again
        CONFIG['db_type'] = 'postgresql'

        trytond.tests.test_tryton.DB_NAME = 'test_' + str(int(time.time()))
        from trytond.tests.test_tryton import DB_NAME
        trytond.tests.test_tryton.DB = backend.get('Database')(DB_NAME)
        from trytond.pool import Pool
        Pool.test = True
        trytond.tests.test_tryton.POOL = Pool(DB_NAME)

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 7
0
    def run(self):
        os.environ['DB_NAME'] = ':memory:'

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 8
0
    def run(self):
        os.environ['DB_NAME'] = ':memory:'

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 9
0
def test():
    import unittest
    import sys

    sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
    import tests

    suite = tests.suite(options.args)
    unittest.TextTestRunner(verbosity=2).run(suite)
Exemplo n.º 10
0
 def run(self):
     import coverage
     import xmlrunner
     cov = coverage.coverage(source=["trytond.modules.avatax_calc"])
     cov.start()
     from tests import suite
     xmlrunner.XMLTestRunner(output="xml-test-results").run(suite())
     cov.stop()
     cov.save()
     cov.xml_report(outfile="coverage.xml")
Exemplo n.º 11
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=2).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 12
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=2).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 13
0
    def run(self):
        os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'
        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 14
0
 def run(self):
     import coverage
     import xmlrunner
     cov = coverage.coverage(source=["trytond.modules.nereid"])
     cov.start()
     from tests import suite
     xmlrunner.XMLTestRunner(output="xml-test-results").run(suite())
     cov.stop()
     cov.save()
     cov.xml_report(outfile="coverage.xml")
Exemplo n.º 15
0
    def run(self):
        os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'
        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 16
0
    def run(self):
        from trytond.config import CONFIG
        CONFIG['db_type'] = 'sqlite'
        os.environ['DB_NAME'] = ':memory:'

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 17
0
    def run(self):
        os.environ["TRYTOND_DATABASE_URI"] = "sqlite://"
        os.environ["DB_NAME"] = ":memory:"

        from tests import suite

        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 18
0
    def run(self):
        from trytond.config import CONFIG
        CONFIG['db_type'] = 'sqlite'
        os.environ['DB_NAME'] = ':memory:'

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 19
0
def run():
    cov = coverage(source=['flask_testing'])
    cov.start()

    from tests import suite
    result = unittest.TextTestRunner(verbosity=2).run(suite())
    if not result.wasSuccessful():
        sys.exit(1)
    cov.stop()
    print("\nCode Coverage")
    cov.report()
    cov.html_report(directory='cover')
Exemplo n.º 20
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)
        os.environ['TRYTOND_DATABASE_URI'] = "sqlite://"
        os.environ['DB_NAME'] = ':memory:'

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 21
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        os.environ['DB_NAME'] = ':memory:'

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 22
0
    def run(self):
        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))
        os.environ['TRYTOND_DATABASE_URI'] = "postgresql://"
        os.environ['TRYTOND_ASYNC__BROKER_URL'] = "redis://localhost:6379/0"
        os.environ['TRYTOND_ASYNC__BACKEND_URL'] = "redis://localhost:6379/1"

        from tests import suite

        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 23
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'
        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 24
0
    def run(self):
        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))
        os.environ['TRYTOND_DATABASE_URI'] = "postgresql://"
        os.environ['TRYTOND_ASYNC__BROKER_URL'] = "redis://localhost:6379/0"
        os.environ['TRYTOND_ASYNC__BACKEND_URL'] = "redis://localhost:6379/1"

        from tests import suite

        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 25
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'
        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 26
0
    def run(self):
        from trytond.config import config
        config.set('database', 'uri',
                   'postgresql://*****:*****@localhost:5432/')

        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 27
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        from trytond.config import CONFIG
        CONFIG['db_type'] = 'sqlite'
        os.environ['DB_NAME'] = ':memory:'

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 28
0
    def run(self):
        from trytond.config import config

        config.set("database", "uri", "postgresql://*****:*****@localhost:5432/")

        os.environ["DB_NAME"] = "test_" + str(int(time.time()))

        from tests import suite

        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 29
0
    def run(self):
        from trytond.config import config
        config.set(
            'database', 'uri', 'postgresql://*****:*****@localhost:5432/'
        )

        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 30
0
    def run(self):
        from openerp.tools import config
        config.options['db_user'] = '******'
        config.options['db_host'] = 'localhost'
        config.options['db_port'] = 5432
        parent_folder, current_folder = os.path.dirname(
            os.path.abspath(__file__)).rsplit('/', 1)
        config.options['addons_path'] += ',' + parent_folder
        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 31
0
    def run(self):
        from trytond.config import CONFIG
        CONFIG['db_type'] = 'postgresql'
        CONFIG['db_host'] = 'localhost'
        CONFIG['db_port'] = 5432
        CONFIG['db_user'] = '******'

        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 32
0
    def run(self):
        from openerp.tools import config
        config.options['db_user'] = '******'
        config.options['db_host'] = 'localhost'
        config.options['db_port'] = 5432
        parent_folder, current_folder = os.path.dirname(
            os.path.abspath(__file__)
        ).rsplit('/', 1)
        config.options['addons_path'] += ',' + parent_folder
        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 33
0
    def run(self):
        from trytond.config import CONFIG
        CONFIG['db_type'] = 'postgresql'
        CONFIG['db_host'] = 'localhost'
        CONFIG['db_port'] = 5432
        CONFIG['db_user'] = '******'

        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        from trytond.config import config
        os.environ['TRYTOND_DATABASE_URI'] = 'sqlite://'
        config.set('email', 'from', '*****@*****.**')
        os.environ['DB_NAME'] = ':memory:'

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 35
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        os.environ['TRYTOND_DATABASE_URI'] = 'sqlite://'
        os.environ['DB_NAME'] = ':memory:'

        from trytond.config import config
        config.add_section('nereid_s3')

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 36
0
def run():
    if coverage_available:
        cov = coverage(source=['flask_mongokit'])
        cov.start()
    
    from tests import suite
    unittest.TextTestRunner(verbosity=2).run(suite())
    
    if coverage_available:
        cov.stop()
        
        print "\nCode Coverage"
        cov.report()
        cov.html_report(directory='cover')
    else:
        print("\nTipp:\n\tUse 'pip install coverage' to get great code "
              "coverage stats")
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        from trytond.config import config

        os.environ["TRYTOND_DATABASE_URI"] = "sqlite://"
        config.set("email", "from", "*****@*****.**")
        os.environ["DB_NAME"] = ":memory:"

        from tests import suite

        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 38
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'
        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from trytond.config import config
        # Add elastic search test configuration
        config.add_section('elastic_search')
        config.set('elastic_search', 'server_uri', 'localhost:9200')

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 39
0
def run():
    if coverage_available:
        cov = coverage(source=['skf'])
        cov.start()

    from tests import suite
    result = unittest.TextTestRunner(verbosity=2).run(suite())
    if not result.wasSuccessful():
        sys.exit(1)

    if coverage_available:
        cov.stop()
        print("\nCode Coverage")
        cov.report()
        cov.html_report(directory='cover')
    else:
        print("\nTipp:\n\tUse 'pip install coverage' to get great code "
              "coverage stats")
Exemplo n.º 40
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'
        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from trytond.config import config
        # Add elastic search test configuration
        config.add_section('elastic_search')
        config.set('elastic_search', 'server_uri', 'localhost:9200')

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        from trytond.config import CONFIG
        CONFIG['db_type'] = 'postgresql'
        CONFIG['db_host'] = 'localhost'
        CONFIG['db_port'] = 5432
        CONFIG['db_user'] = '******'
        CONFIG['smtp_from'] = '*****@*****.**'

        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 42
0
    def run(self):
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        from trytond.config import CONFIG
        CONFIG['db_type'] = 'postgresql'
        CONFIG['db_host'] = 'localhost'
        CONFIG['db_port'] = 5432
        CONFIG['db_user'] = '******'
        CONFIG['smtp_from'] = '*****@*****.**'

        os.environ['DB_NAME'] = 'test_' + str(int(time.time()))

        from tests import suite
        test_result = unittest.TextTestRunner(verbosity=3).run(suite())

        if test_result.wasSuccessful():
            sys.exit(0)
        sys.exit(-1)
Exemplo n.º 43
0
import unittest
import tests

unittest.TextTestRunner(verbosity=2).run(tests.suite())
Exemplo n.º 44
0
def tests():
	import tests
	return tests.suite()
Exemplo n.º 45
0
class _WriteDecorator(object):
    __slots__ = [ 'stream' ]

    def __init__(self, stream):
        self.stream = stream
    #-def

    def __getattr__(self, attr):
        if attr in ('stream', '__getstate__'):
            return AttributeError(attr)
        return getattr(self.stream, attr)
    #-def

    def write(self, text):
        try:
            self.stream.write(text)
        except UnicodeEncodeError:
            bytes = text.encode(self.stream.encoding, 'backslashreplace')
            if hasattr(self.stream, 'buffer'):
                self.stream.buffer.write(bytes)
            else:
                text = bytes.decode(self.stream.encoding, 'strict')
                self.stream.write(text)
    #-def
#-class

if __name__ == '__main__':
    stream = _WriteDecorator(sys.stdout)
    unittest.TextTestRunner(stream, True, 2).run(tests.suite())
#-if
Exemplo n.º 46
0
#!/usr/bin/env python

# (void)walker unit tests
# Copyright (C) 2012 David Holm <*****@*****.**>

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
import unittest

import tests


suite = tests.suite()
runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)
sys.exit({True: 0, False: 3}[result.wasSuccessful()])
Exemplo n.º 47
0
#!/usr/bin/env python

import xmlrunner
import coverage
from tests import suite

if __name__ == '__main__':
    cov = coverage.coverage()
    cov.erase()
    cov.start()
    xmlrunner.XMLTestRunner(output='test-reports').run(suite())
    cov.stop()
    cov.save()
    cov.xml_report()
Exemplo n.º 48
0
import unittest
import tests
import definition
import fixed_definition

if __name__ == '__main__':
    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(tests.suite(definition.Account, definition.Advertiser))
    runner.run(
        tests.suite(fixed_definition.Account, fixed_definition.Advertiser))
Exemplo n.º 49
0
#!/usr/bin/env python

# (void)walker unit tests
# Copyright (C) 2012 David Holm <*****@*****.**>

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
import unittest

import tests

suite = tests.suite()
runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)
sys.exit({True: 0, False: 3}[result.wasSuccessful()])
Exemplo n.º 50
0
 def run(self):
     import unittest
     import tests
     suite = tests.suite(self.lang)
     unittest.TextTestRunner(verbosity=2).run(suite)
Exemplo n.º 51
0
def run_tests():
    from tests import suite
    return suite()
Exemplo n.º 52
0
def run_tests():
    from tests import suite
    return suite()
Exemplo n.º 53
0
from tests import suite
import unittest

ts = suite()
unittest.TextTestRunner(verbosity=2).run(ts)
Exemplo n.º 54
0
import unittest

from tests import suite

runner = unittest.TextTestRunner()
runner.run(suite())
Exemplo n.º 55
0
            res.append(elements.pop(factoradic_value[i]))
        return res

    @staticmethod
    def generate_permutation_from_factoradic(
            factoradic_value,
            elements):  # helper to avoid modifying any parameters
        return Factoradic.generate_permutation_from_factoradic_inplace(
            factoradic_value, elements[:])

    @staticmethod
    def padded_to_length_s(factoradic_value, new_len):
        if len(factoradic_value) < new_len:
            diff = new_len - len(factoradic_value)
            padding = [0] * diff
            padding.extend(factoradic_value)
            return padding
        return factoradic_value


if __name__ == "__main__":
    import tests

    suite = tests.unittest.TestLoader().loadTestsFromTestCase(
        tests.TestCaseFactoradicLowlevel)
    suite.addTests(tests.unittest.TestLoader().loadTestsFromTestCase(
        tests.TestCaseFactoradicObject))
    tests.unittest.TextTestRunner(verbosity=2).run(suite)

    tests.unittest.TestSuite(tests.suite())