conftest.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import os
  2. import shutil
  3. import pytest
  4. # pylint: disable=redefined-outer-name
  5. @pytest.fixture
  6. def tracks_dir_path():
  7. return os.path.join(os.path.dirname(__file__), "tracks")
  8. @pytest.fixture
  9. def empty_id3_path(tmpdir, tracks_dir_path):
  10. path = tmpdir.join("empty.mp3").strpath
  11. shutil.copyfile(src=os.path.join(tracks_dir_path, "id3v2.4-empty.mp3"), dst=path)
  12. return path
  13. @pytest.fixture
  14. def empty_mp4_path(tmpdir, tracks_dir_path):
  15. path = tmpdir.join("empty.m4a").strpath
  16. shutil.copyfile(src=os.path.join(tracks_dir_path, "mp4-aac-empty.m4a"), dst=path)
  17. return path
  18. @pytest.fixture
  19. def empty_ogg_opus_path(tmpdir, tracks_dir_path):
  20. path = tmpdir.join("empty.opus").strpath
  21. shutil.copyfile(src=os.path.join(tracks_dir_path, "ogg-opus-empty.opus"), dst=path)
  22. return path
  23. @pytest.fixture
  24. def empty_ogg_vorbis_path(tmpdir, tracks_dir_path):
  25. path = tmpdir.join("empty.ogg").strpath
  26. shutil.copyfile(src=os.path.join(tracks_dir_path, "ogg-vorbis-empty.ogg"), dst=path)
  27. return path