跳转到主要内容

Django storage for fake.py

项目描述

Django storage for fake.py.

PyPI Version Supported Python versions Build Status Documentation Status MIT Coverage

fake-py-django-storageDjango storage integration for fake.py - 一个独立、便携的库,用于生成各种随机数据类型以进行测试。

功能

先决条件

Python 3.9+

安装

pip install fake-py-django-storage

文档

用法

DjangoFileSystemStorage

from fake import FAKER
from fakepy.django_storage.filesystem import DjangoFileSystemStorage

STORAGE = DjangoFileSystemStorage(
    root_path="tmp",  # Optional
    rel_path="sub-tmp",  # Optional
)

pdf_file = FAKER.pdf_file(storage=STORAGE)

STORAGE.exists(pdf_file)

AWS S3(使用 django-storages

from fake import FAKER
from fakepy.django_storage.aws_s3 import DjangoAWSS3Storage

STORAGE = DjangoAWSS3Storage(
    root_path="tmp",  # Optional
    rel_path="sub-tmp",  # Optional
)

pdf_file = FAKER.pdf_file(storage=STORAGE)

STORAGE.exists(pdf_file)

Google Cloud Storage(使用 django-storages

from fake import FAKER
from fakepy.django_storage.google_cloud_storage import (
    DjangoGoogleCloudStorage,
)

STORAGE = DjangoGoogleCloudStorage(
    root_path="tmp",  # Optional
    rel_path="sub-tmp",  # Optional
)

pdf_file = FAKER.pdf_file(storage=STORAGE)

STORAGE.exists(pdf_file)

Azure Cloud Storage(使用 django-storages

from fake import FAKER
from fakepy.django_storage.azure_cloud_storage import (
    DjangoAzureCloudStorage,
)

STORAGE = DjangoAzureCloudStorage(
    root_path="tmp",  # Optional
    rel_path="sub-tmp",  # Optional
)

pdf_file = FAKER.pdf_file(storage=STORAGE)

STORAGE.exists(pdf_file)

测试

pytest

编写文档

保持以下层次结构。

=====
title
=====

header
======

sub-header
----------

sub-sub-header
~~~~~~~~~~~~~~

sub-sub-sub-header
^^^^^^^^^^^^^^^^^^

sub-sub-sub-sub-header
++++++++++++++++++++++

sub-sub-sub-sub-sub-header
**************************

许可证

MIT 许可证

支持

对于安全问题,请联系作者部分的电子邮件地址。

对于总体问题,请访问 GitHub

作者

Artur Barseghyan <artur.barseghyan@gmail.com>

项目详情


下载文件

下载适用于您平台的应用程序。如果您不确定要选择哪个,请了解更多关于 安装包 的信息。

源代码分发

fake_py_django_storage-0.1.1.tar.gz (32.6 kB 查看哈希值)

上传时间 源代码

构建分发

fake_py_django_storage-0.1.1-py3-none-any.whl (13.5 kB 查看哈希值)

上传时间 Python 3

由以下支持