def main():
    print('Download the test assets')
    for url, filename in constants.TEST_ASSETS:
        download_ext(url, filename, force=False)

    print('Download ffmpeg static binary')
    try:
        download_ext(constants.FFMPEG_URL,
                     constants.FFMPEG_ARCHIVE,
                     force=False)
        if six.PY2:
            import contextlib, lzma
            with contextlib.closing(lzma.LZMAFile(
                    constants.FFMPEG_ARCHIVE)) as xz:
                with tarfile.open(fileobj=xz) as f:
                    f.extractall(constants.TESTS_DIRECTORY)
        else:
            with tarfile.open(constants.FFMPEG_ARCHIVE) as f:
                f.extractall(constants.TESTS_DIRECTORY)
        for filename in 'ffmpeg', 'ffprobe':
            shutil.copy(join(constants.FFMPEG_DIRECTORY, filename),
                        tempfile.gettempdir())
    except BadHTTPResponseCodeError:
        print('Unable to download ffmpeg: Will mock ffmpeg if missing')

    print('Run the tests with nose')
    # Ignore django module (how to filter by module ?) + ignore ming module if Python > 2.x
    ignore = (
        'fields.py|mixins.py|signals.py|storage.py|utils.py|validators.py|widgets.py|pytoolbox_filters.py|'
        'pytoolbox_tags.py' +
        ('|session.py|schema.py' if sys.version_info[0] > 2 else ''))
    return runtests(__file__,
                    cover_packages=['pytoolbox'],
                    packages=['pytoolbox', 'tests'],
                    ignore=ignore)
Beispiel #2
0
def main():
    print('Configure Django')
    try:
        from django.conf import settings
        settings.configure()
    except ImportError:
        print('WARNING: Django not available for testing purposes')

    print('Download ffmpeg static binary')
    try:
        download_ext(constants.FFMPEG_URL, constants.FFMPEG_ARCHIVE, force=False)
        if six.PY2:
            import contextlib
            try:
                import lzma
            except ImportError:
                from backports import lzma
            with contextlib.closing(lzma.LZMAFile(constants.FFMPEG_ARCHIVE)) as xz:
                with tarfile.open(fileobj=xz) as f:
                    f.extractall(constants.TESTS_DIRECTORY)
        else:
            with tarfile.open(constants.FFMPEG_ARCHIVE) as f:
                f.extractall(constants.TESTS_DIRECTORY)
        for path in 'ffmpeg', 'ffprobe':
            shutil.copy(os.path.join(constants.FFMPEG_DIRECTORY, path), tempfile.gettempdir())
    except BadHTTPResponseCodeError:
        print('Unable to download ffmpeg: Will mock ffmpeg if missing')

    print('Run the tests with nose')
    return runtests(__file__, cover_packages=['pytoolbox'], packages=['pytoolbox', 'tests'])
def main():
    print('Download the test assets')
    for url, filename in constants.TEST_ASSETS:
        download_ext(url, filename, force=False)

    print('Download ffmpeg static binary')
    try:
        download_ext(constants.FFMPEG_URL, constants.FFMPEG_ARCHIVE, force=False)
        if six.PY2:
            import contextlib, lzma
            with contextlib.closing(lzma.LZMAFile(constants.FFMPEG_ARCHIVE)) as xz:
                with tarfile.open(fileobj=xz) as f:
                    f.extractall(constants.TESTS_DIRECTORY)
        else:
            with tarfile.open(constants.FFMPEG_ARCHIVE) as f:
                f.extractall(constants.TESTS_DIRECTORY)
        for filename in 'ffmpeg', 'ffprobe':
            shutil.copy(join(constants.FFMPEG_DIRECTORY, filename), tempfile.gettempdir())
    except BadHTTPResponseCodeError:
        print('Unable to download ffmpeg: Will mock ffmpeg if missing')

    print('Run the tests with nose')
    # Ignore django module (how to filter by module ?) + ignore ming module if Python > 2.x
    ignore = ('fields.py|mixins.py|signals.py|storage.py|utils.py|validators.py|widgets.py|pytoolbox_filters.py|'
              'pytoolbox_tags.py' + ('|session.py|schema.py' if sys.version_info[0] > 2 else ''))
    return runtests(__file__, cover_packages=['pytoolbox'], packages=['pytoolbox', 'tests'], ignore=ignore)
def main():
    print('Configure Django')
    settings.configure()

    print('Download the test assets')
    for url, path in constants.TEST_ASSETS:
        download_ext(url, path, force=False)

    print('Download ffmpeg static binary')
    try:
        download_ext(constants.FFMPEG_URL, constants.FFMPEG_ARCHIVE, force=False)
        if six.PY2:
            import contextlib
            try:
                import lzma
            except ImportError:
                from backports import lzma
            with contextlib.closing(lzma.LZMAFile(constants.FFMPEG_ARCHIVE)) as xz:
                with tarfile.open(fileobj=xz) as f:
                    f.extractall(constants.TESTS_DIRECTORY)
        else:
            with tarfile.open(constants.FFMPEG_ARCHIVE) as f:
                f.extractall(constants.TESTS_DIRECTORY)
        for path in 'ffmpeg', 'ffprobe':
            shutil.copy(os.path.join(constants.FFMPEG_DIRECTORY, path), tempfile.gettempdir())
    except BadHTTPResponseCodeError:
        print('Unable to download ffmpeg: Will mock ffmpeg if missing')

    print('Run the tests with nose')
    return runtests(__file__, cover_packages=['pytoolbox'], packages=['pytoolbox', 'tests'],
                    ignore='session.py|schema.py')  # Ignore ming FIXME filter by package
def main():
    print(u'Download the test media assets')
    root = dirname(__file__)
    download(u'http://techslides.com/demos/sample-videos/small.mp4', join(root, u'small.mp4'))
    print(u'Run the tests with nose')
    # Ignore django module (how to filter by module ?) + ignore ming module if Python > 2.x
    ignore = (u'forms.py|models.py|signals.py|storage.py|views.py|widgets.py|pytoolbox_tags.py' +
              (u'|session.py|schema.py' if sys.version_info[0] > 2 else u''))
    return runtests(__file__, cover_packages=[u'pytoolbox'], packages=[u'pytoolbox', u'tests'], ignore=ignore)
def main():
    from pytoolbox.unittest import runtests
    return runtests(__file__, cover_packages=[u'oscied_lib'], packages=[u'oscied_lib', u'tests'], ignore='test.py')
Beispiel #7
0
def main():
    configure_unicode()
    set_test_settings()
    return runtests(__file__,
                    cover_packages=[u'encodebox'],
                    packages=[u'encodebox', u'tests'])
def main():
    # Ignore django module (how to filter by module ?) + ignore ming module if Python > 2.x
    ignore = (u'forms.py|models.py|signals.py|storage.py|views.py|widgets.py|pytoolbox_tags.py' +
              (u'|session.py|schema.py' if sys.version_info[0] > 2 else u''))
    return runtests(__file__, cover_packages=[u'pytoolbox'], packages=[u'pytoolbox'], ignore=ignore)