コード例 #1
0
def dependency():
    from pystaticpage.dependency import set_dependencies, Dependency, dependency

    LOG.clear()
    set_dependencies(Dependency(open_file=fake_open(LOG, FILES_CONTENT)))

    return dependency
コード例 #2
0
def dependency():
    from pystaticpage.dependency import set_dependencies, Dependency, dependency

    LOG.clear()
    set_dependencies(Dependency(
        path_class=fake_path(LOG, [r'data/company\.yml']),
        open_file=fake_open(LOG, FILES_CONTENT),
    ))

    return dependency
コード例 #3
0
def dependency():
    dep.reset_dependencies()
    dep.set_dependencies(
        dep.Dependency(utils_iter_files=fake_iter_file(LOG, './dirs/cdn',
                                                       CDN_DIR_FILES),
                       boto_session=fake_session(LOG),
                       minify=fake_minify(LOG),
                       time=lambda: 1635217453.7966132,
                       open_file=fake_open([], {})))

    return dep.dependency
コード例 #4
0
def dependency():
    from pystaticpage.dependency import set_dependencies, Dependency, dependency

    LOG.clear()
    set_dependencies(
        Dependency(
            requests_post=fake_post(LOG),
            open_file=fake_open(LOG, FILES_CONTENT),
        ))

    return dependency
コード例 #5
0
def dependency():
    LOG.clear()
    dep.reset_dependencies()
    dep.set_dependencies(dep.Dependency(
        boto_session=fake_session(LOG),
        requests_post=fake_post(LOG),
        time=lambda: 1635217453.7966132
    ))

    yield dep.dependency

    delete_folders(ROOT.joinpath('dirs', '_sites'))
コード例 #6
0
def dependency():
    LOG.clear()

    dep.set_dependencies(dep.Dependency(
        path_class=Path,
        utils_iter_files=fake_iter_file(LOG, Path('dirs/static'), STATIC_DIR_FILES),
        utils_copy_file=fake_func('copy_file', LOG),
        utils_gzip_file=fake_func('gzip', LOG),
        minify=fake_func('minify', LOG, [
            Path('dirs/sites/static/main.min.css'),
            Path('dirs/sites/static/app.min.js'),
        ]),
    ))

    return dep.dependency
コード例 #7
0
def dependency():
    from pystaticpage.dependency import set_dependencies, Dependency, dependency

    LOG.clear()
    path_class = fake_path(LOG)
    set_dependencies(
        Dependency(utils_iter_files=fake_iter_file(LOG, 'dirs/pages',
                                                   PAGES_FILES),
                   path_class=path_class,
                   open_file=fake_open(LOG, FILE_CONTENTS),
                   jinja_loader_class=fake_loader(LOG),
                   utils_save_content=fake_func('utils_save_content', LOG),
                   utils_copy_file=fake_func('utils_copy_file', LOG),
                   utils_gzip_file=fake_func('utils_gzip_file', LOG),
                   minify=fake_func('minify', LOG, [
                       path_class('dirs/sites/index.html'),
                       path_class('dirs/sites/contact/index.html'),
                       path_class('dirs/sites/contact/index.html'),
                   ])))

    return dependency
コード例 #8
0
def dependency():
    LOG.clear()
    dep.reset_dependencies()
    dep.set_dependencies(
        dep.Dependency(
            minify=fake_func('minify', LOG, [
                Path('dirs/sites/static/css/main.min.css'),
                Path('dirs/sites/static/css/table.min.css'),
            ]),
            utils_gzip_file=fake_func('gzip_file', LOG),
            utils_gzip_data=fake_func('gzip_data', LOG),
            sass_compile=fake_func('sass_compile', LOG,
                                   ['compiled-main', 'compiled-table']),
            utils_save_content=fake_func('save_content', LOG),
            utils_iter_files=fake_iter_file([], './dirs/sass', [
                Path('./dirs/sass/main.sass'),
                Path('./dirs/sass/table.scss'),
                Path('./dirs/sass/readme.txt'),
            ])))

    return dep.dependency