API directory

Requirements

Requires the “NAI_USERNAME” and “NAI_PASSWORD” values provided via environment variables. They can be provided through a .env file at the root of the project.

The “NAI_PROXY” environment variable is also supported to inject a proxy address.

Usage

For running all the tests under the tests/api folder :

poetry run nai-test-api

For running a specific test files (using the pytest name scheme) :

poetry run nai-test-api <filename 1> ... <filename n>

Remember to run poetry install before running the test, if not already done.

Content

test_decrypt_encrypt_integrity_check.py

Test if the content decryption/decompression is consistent with encryption/compression for downloaded content

async keystore_integrity()[source]

Verify the integrity of the keystore on decryption - encryption

async stories_integrity()[source]

Verify the integrity of ‘stories’ objects on decryption - encryption

async storycontent_integrity()[source]

Verify the integrity of ‘storycontent’ objects on decryption - encryption

async presets_integrity()[source]

Verify the integrity of ‘presets’ objects on decompression - compression

async aimodules_integrity()[source]

Verify the integrity of ‘aimodules’ objects on decryption - encryption

async shelves_integrity()[source]

Verify the integrity of ‘shelves’ objects on decompression - compression

test_imagegen_samplers.py

Test which samplers currently work

test_sync_gen.py

Test if sync capabilities work without problem
This test only checks if sync works, not if the result is right, it’s the job of the other tests

test_textgen_presets.py

Tests pertaining to the Preset class

async test_presets()[source]

Test the presets to ensure they work with the API

async preset_from_default()[source]

Test the from_default constructor of Preset

async preset_from_official()[source]

Test the from_official constructor of Preset

test_textgen_sanity.py

Disabled

… automodule:: tests.api.test_textgen_sanity
members:

Reference