test_convert_track_id.py 554 B

123456789101112131415
  1. from yandex_music.utils.convert_track_id import convert_track_id_to_number
  2. class TestConvertTrackId:
  3. track_id = 37696396
  4. album_id = 4784420
  5. def test_convert_from_str(self):
  6. assert convert_track_id_to_number(f'{self.track_id}:{self.album_id}') == self.track_id
  7. assert convert_track_id_to_number(f'{self.track_id}:') == self.track_id
  8. assert convert_track_id_to_number(f'{self.track_id}') == self.track_id
  9. def test_convert_from_int(self):
  10. assert convert_track_id_to_number(self.track_id) == self.track_id