mirror of
https://github.com/facefusion/facefusion.git
synced 2026-04-22 17:36:16 +02:00
04f6a2c758
* Introduce API scelleton * Raw impl for session * Simple state endpoint * Apply _body naming * Finalize session testing and comment out tons of useless code * Clean and refactor part1 * Clean and refactor part2 * Clean and refactor part2 * Clean and refactor part2 * Clean and refactor part2 * Refactor middleware * Refactor middleware * Clean and refactor part3 * TDD and 2 beers * TDD and 2 beers * Complete state endpoints * You can only set what is already present * Use only JSON as response * Use default logger * Improve auth extraction * Extend api command with more args * Adjust API messages
23 lines
463 B
Python
23 lines
463 B
Python
import os
|
|
import tempfile
|
|
|
|
from facefusion.json import read_json, write_json
|
|
|
|
|
|
def test_read_json() -> None:
|
|
file_descriptor, json_path = tempfile.mkstemp(suffix = '.json')
|
|
os.close(file_descriptor)
|
|
|
|
assert read_json(json_path) is None
|
|
|
|
write_json(json_path, {})
|
|
|
|
assert read_json(json_path) == {}
|
|
|
|
|
|
def test_write_json() -> None:
|
|
file_descriptor, json_path = tempfile.mkstemp(suffix = '.json')
|
|
os.close(file_descriptor)
|
|
|
|
assert write_json(json_path, {})
|