conftest.py 1.1 KB

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