conftest.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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(
  12. src=os.path.join(tracks_dir_path, "id3v2.4-empty.mp3"), dst=path,
  13. )
  14. return path
  15. @pytest.fixture
  16. def empty_mp4_path(tmpdir, tracks_dir_path):
  17. path = tmpdir.join("empty.m4a").strpath
  18. shutil.copyfile(
  19. src=os.path.join(tracks_dir_path, "mp4-aac-empty.m4a"), dst=path,
  20. )
  21. return path
  22. @pytest.fixture
  23. def empty_ogg_opus_path(tmpdir, tracks_dir_path):
  24. path = tmpdir.join("empty.opus").strpath
  25. shutil.copyfile(
  26. src=os.path.join(tracks_dir_path, "ogg-opus-empty.opus"), dst=path,
  27. )
  28. return path
  29. @pytest.fixture
  30. def empty_ogg_vorbis_path(tmpdir, tracks_dir_path):
  31. path = tmpdir.join("empty.ogg").strpath
  32. shutil.copyfile(
  33. src=os.path.join(tracks_dir_path, "ogg-vorbis-empty.ogg"), dst=path,
  34. )
  35. return path