test_json.py 367 B

12345678910111213141516171819
  1. import tempfile
  2. from facefusion.json import read_json, write_json
  3. def test_read_json() -> None:
  4. _, json_path = tempfile.mkstemp(suffix = '.json')
  5. assert not read_json(json_path)
  6. write_json(json_path, {})
  7. assert read_json(json_path) == {}
  8. def test_write_json() -> None:
  9. _, json_path = tempfile.mkstemp(suffix = '.json')
  10. assert write_json(json_path, {})