1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-11-10 04:02:17 +00:00
supysonic/tests/issue133.py

40 lines
1020 B
Python
Raw Normal View History

2019-02-09 14:39:58 +00:00
# This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
2022-12-31 16:17:49 +00:00
# Copyright (C) 2019-2022 Alban 'spl0k' Féron
2019-02-09 14:39:58 +00:00
#
# Distributed under terms of the GNU AGPLv3 license.
import shutil
import tempfile
import unittest
from supysonic.db import init_database, release_database
from supysonic.db import Track
2019-02-09 14:39:58 +00:00
from supysonic.managers.folder import FolderManager
from supysonic.scanner import Scanner
2019-06-29 15:25:44 +00:00
2019-02-09 14:39:58 +00:00
class Issue133TestCase(unittest.TestCase):
def setUp(self):
self.__dir = tempfile.mkdtemp()
2019-06-29 15:25:44 +00:00
shutil.copy("tests/assets/issue133.flac", self.__dir)
init_database("sqlite:")
2022-12-31 16:17:49 +00:00
FolderManager.add("folder", self.__dir)
2019-02-09 14:39:58 +00:00
def tearDown(self):
release_database()
shutil.rmtree(self.__dir)
def test_issue133(self):
scanner = Scanner()
2019-06-29 15:25:44 +00:00
scanner.queue_folder("folder")
2019-05-11 15:13:58 +00:00
scanner.run()
2019-02-09 14:39:58 +00:00
track = Track.select().first()
2019-06-29 15:25:44 +00:00
self.assertNotIn("\x00", track.title)
2019-02-09 14:39:58 +00:00
2019-06-29 15:25:44 +00:00
if __name__ == "__main__":
unittest.main()