示例#1
0
    def test_doc(self):
        suite = TestSuite()

        for filename in os.listdir('../'):
            if filename.endswith(".py"):
                suite.addTest(doctest.DocFileSuite('../' + filename))

        runner = TextTestRunner(verbosity=2)
        runner.run(suite)
示例#2
0
    def test_doc(self):
        suite = TestSuite()

        for filename in os.listdir('../'):
            if filename.endswith(".py"):
                suite.addTest(doctest.DocFileSuite('../' + filename))

        runner = TextTestRunner(verbosity=2)
        runner.run(suite)
示例#3
0
def suite():
    """Returns the test suite for this module."""

    result = TestSuite()
    loader = defaultTestLoader

    result.addTest(loader.loadTestsFromModule(test_api))

    return result
示例#4
0
def load_tests(loader, standard_tests, pattern):
    """Returns the test suite for this module."""
    suite = TestSuite()
    suite.addTest(loader.loadTestsFromTestCase(ModelTestCase))
    suite.addTest(loader.loadTestsFromTestCase(FSAModelTest))
    suite.addTest(loader.loadTestsFromTestCase(FunctionAPITestCase))
    suite.addTest(loader.loadTestsFromTestCase(FunctionEvaluationTest))
    suite.addTest(loader.loadTestsFromTestCase(APITestCase))
    return suite
示例#5
0
def test_suite():
    suite = TestSuite()
    OPTIONFLAGS = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)
    for testfile in ('testBrowserLayers.txt', 'testCustomizeView.txt'):
        suite.addTest(FunctionalDocFileSuite(testfile,
                                optionflags=OPTIONFLAGS,
                                package="plone.app.customerize.tests",
                                test_class=CustomerizeFunctionalTestCase),
                     )
    return suite
示例#6
0
def suite():
    """Returns the test suite for this module."""
    result = TestSuite()
    loader = defaultTestLoader
    result.addTest(loader.loadTestsFromModule(test_helpers))
    result.addTest(loader.loadTestsFromModule(test_manager))
    result.addTest(loader.loadTestsFromModule(test_search))
    result.addTest(loader.loadTestsFromModule(test_validation))
    result.addTest(loader.loadTestsFromModule(test_views))
    result.addTest(loader.loadTestsFromModule(test_processors))
    return result
示例#7
0
def load_tests(loader, standard_tests, pattern):
    """Loads the tests from this module"""

    suite = TestSuite()
    # Only enable if you have a local server running.
    # TODO: Consider automatic skipping if zmq fails to connect
    # suite.addTest(loader.loadTestsFromTestCase(LiveGuessApiTestCase))
    suite.addTest(loader.loadTestsFromTestCase(ClientTestCase))
    suite.addTest(loader.loadTestsFromTestCase(CORSTestCase))

    return suite
示例#8
0
def load_tests(loader, standard_tests, pattern):
    """Returns the test suite for this module."""
    suite = TestSuite()
    suite.addTest(loader.loadTestsFromTestCase(ModelTestCase))
    suite.addTest(loader.loadTestsFromTestCase(FunctionAPITestCase))
    suite.addTest(loader.loadTestsFromTestCase(FunctionEvaluationTest))
    suite.addTest(loader.loadTestsFromTestCase(APITestCase))
    return suite
def get_suite(test_names, test_dir, file_match, browser_type, browser_version,
              browser_platform, session_name, javascript_disabled,
              webdriver_remote_url, screenshots_on, found, failfast, debug,
              extended=False):

    suite = TestSuite()

    dir_list = os.listdir(test_dir)

    # filter directory entries that don't match the file match pattern
    dir_list = [f for f in dir_list if fnmatch.fnmatch(f, file_match)]

    for entry in dir_list:
        if not entry.endswith('.py'):
            continue
        if test_names and entry[:-3] not in test_names:
            continue
        elif not test_names:
            if entry.startswith('_'):
                # ignore entries starting with underscore unless specified
                continue
        found.add(entry[:-3])

        csv_path = os.path.join(test_dir, entry.replace('.py', '.csv'))
        if os.path.isfile(csv_path):
            # reading the csv file now
            for row in get_data(csv_path):
                # row is a dictionary of variables
                suite.addTest(
                    get_case(
                        test_dir, entry, browser_type, browser_version,
                        browser_platform, session_name, javascript_disabled,
                        webdriver_remote_url, screenshots_on, row,
                        failfast=failfast, debug=debug, extended=extended
                    )
                )
        else:
            suite.addTest(
                get_case(
                    test_dir, entry, browser_type, browser_version,
                    browser_platform, session_name, javascript_disabled,
                    webdriver_remote_url, screenshots_on,
                    failfast=failfast, debug=debug, extended=extended
                )
            )

    return suite
示例#10
0
def load_tests(loader, standard_tests, pattern):
    """Returns the test suite for this module."""
    suite = TestSuite()
    suite.addTest(loader.loadTestsFromTestCase(OperatorsTest))
    suite.addTest(loader.loadTestsFromTestCase(QueryCreationTest))
    suite.addTest(loader.loadTestsFromTestCase(SearchTest))
    return suite
示例#11
0
def load_tests(loader, standard_tests, pattern):
    """Returns the test suite for this module."""
    suite = TestSuite()
    suite.addTest(loader.loadTestsFromTestCase(OperatorsTest))
    suite.addTest(loader.loadTestsFromTestCase(QueryCreationTest))
    suite.addTest(loader.loadTestsFromTestCase(SearchTest))
    return suite
示例#12
0
def suite():
    suite = TestSuite()
    suite.addTest(defaultTestLoader.loadTestsFromTestCase(TestParseLine))
    suite.addTest(defaultTestLoader.loadTestsFromTestCase(TestFuzzyMatch))
    if is_win:
        suite.addTest(defaultTestLoader.loadTestsFromTestCase(TestAppIdentification))
    return suite
示例#13
0
def get_suite(test_names, test_dir, collect_only, browser_type, device,
              version, browser_platform, session_name, javascript_disabled,
              webdriver_remote_url, screenshots_on, failfast, debug,
              custom_options=None, extended=False, saucelabs_enabled=False,
              browserstack_enabled=False, vagrant_enabled=False, skip_tracking=False):

    suite = TestSuite()

    for case in find_cases(test_names, test_dir):
        csv_path = os.path.join(test_dir, case.replace('.py', '.csv'))
        if os.path.isfile(csv_path):
            # reading the csv file now
            for row in get_data(csv_path):
                # row is a dictionary of variables
                suite.addTest(
                    get_case(
                        test_dir, case, browser_type, device, version,
                        browser_platform, session_name, javascript_disabled,
                        webdriver_remote_url, screenshots_on, row, saucelabs_enabled=saucelabs_enabled,
                        browserstack_enabled=browserstack_enabled, vagrant_enabled=vagrant_enabled,
                        custom_options=custom_options, failfast=failfast,
                        debug=debug, extended=extended, skip_tracking=skip_tracking
                    )
                )
        else:
            suite.addTest(
                get_case(
                    test_dir, case, browser_type, device, version,
                    browser_platform, session_name, javascript_disabled,
                    webdriver_remote_url, screenshots_on,
                    custom_options=custom_options, failfast=failfast,
                    browserstack_enabled=browserstack_enabled, vagrant_enabled=vagrant_enabled,
                    debug=debug, extended=extended, saucelabs_enabled=saucelabs_enabled,
                    skip_tracking=skip_tracking
                )
            )

    return suite
示例#14
0
def get_suite(test_names, test_dir, count_only, browser_type, browser_version,
              browser_platform, session_name, javascript_disabled,
              webdriver_remote_url, screenshots_on, failfast, debug,
              extended=False):

    suite = TestSuite()
    if allscrewedup:
        print "ENTERING get_suite \n"
        print inspect.getargspec(get_suite)
        print [locals()[arg] for arg in inspect.getargspec(get_suite).args]

    for case in find_cases(test_names, test_dir):
        csv_path = os.path.join(test_dir, case.replace('.py', '.csv'))
        if os.path.isfile(csv_path):
            # reading the csv file now
            for row in get_data(csv_path):
                # row is a dictionary of variables
                suite.addTest(
                    get_case(
                        test_dir, case, browser_type, browser_version,
                        browser_platform, session_name, javascript_disabled,
                        webdriver_remote_url, screenshots_on, row,
                        failfast=failfast, debug=debug, extended=extended
                    )
                )
        else:
            suite.addTest(
                get_case(
                    test_dir, case, browser_type, browser_version,
                    browser_platform, session_name, javascript_disabled,
                    webdriver_remote_url, screenshots_on,
                    failfast=failfast, debug=debug, extended=extended
                )
            )

    return suite
示例#15
0
def suite():
    suite = TestSuite()
    for test in make_json_suite():
        for p in test['pass']:
            datum = json.loads(json.dumps(p.datum))
            suite.addTest(make_pass(test['schema'], datum))
            suite.addTest(make_reserialize(test['schema'], datum))
        for f in test['fail']:
            datum = json.loads(json.dumps(f.datum))
            suite.addTest(make_fail(test['schema'], datum))
    return suite
示例#16
0
def suite():
    suite = TestSuite()
    for test in make_json_suite():
        for p in test['pass']:
            datum = json.loads(json.dumps(p.datum))
            suite.addTest(make_pass(test['schema'], datum))
            suite.addTest(make_reserialize(test['schema'], datum))
        for f in test['fail']:
            datum = json.loads(json.dumps(f.datum))
            suite.addTest(make_fail(test['schema'], datum))
    return suite
示例#17
0
def test_suite():
    from unittest2 import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(DepartmentTests))
    return suite
示例#18
0
def load_tests(loader, standard_tests, pattern):
    """Returns the test suite for this module."""
    suite = TestSuite()
    suite.addTest(loader.loadTestsFromTestCase(HelpersTest))
    suite.addTest(loader.loadTestsFromTestCase(ModelHelpersTest))
    return suite
def test_suite():
    from unittest2 import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(PreconditionTests))
    suite.addTest(makeSuite(PreconditionRegistryTests))
    return suite
def test_suite():
    from unittest2 import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(BasicTests))
    return suite
示例#21
0
def load_tests(loader, standard_tests, pattern):
    """Returns the test suite for this module."""
    suite = TestSuite()
    suite.addTest(loader.loadTestsFromTestCase(ProcessorsTest))
    return suite
示例#22
0
def load_tests(loader, standard_tests, pattern):
    """Returns the test suite for this module."""
    suite = TestSuite()
    suite.addTest(loader.loadTestsFromTestCase(SimpleValidationTest))
    suite.addTest(loader.loadTestsFromTestCase(SAVTest))
    return suite
示例#23
0
def test_suite():
    from unittest2 import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(InstitutionTests))
    suite.addTest(makeSuite(InstitutionPortletTests))
    return suite
def test_suite():
    from unittest2 import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(BasicTests))
    return suite
示例#25
0
def test_suite():
    from unittest2 import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(NumberMixinTests))
    return suite
示例#26
0
def load_tests(loader, standard_tests, pattern):
    """Returns the test suite for this module."""
    suite = TestSuite()
    suite.addTest(loader.loadTestsFromTestCase(SimpleValidationTest))
    suite.addTest(loader.loadTestsFromTestCase(SAVTest))
    return suite
示例#27
0
def load_tests(loader, standard_tests, pattern):
    """Returns the test suite for this module."""
    suite = TestSuite()
    suite.addTest(loader.loadTestsFromTestCase(APIManagerTest))
    suite.addTest(loader.loadTestsFromTestCase(FSATest))
    return suite
def test_suite():
    from unittest2 import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(PreconditionTests))
    suite.addTest(makeSuite(PreconditionRegistryTests))
    return suite