def test_lyric_filename_search_builtin_default(self): """test built-in default""" with self.lyric_filename_test_setup(no_config=True) as ts: fp = os.path.join(ts.root, ts["artist"], ts["title"] + ".lyric") p = os.path.dirname(fp) mkdir(p) with io.open(fp, "w", encoding='utf-8') as f: f.write(u"") search = unquote(ts.lyric_filename) os.remove(fp) os.rmdir(p) self.assertEqual(search, fp)
def test_lyric_filename_search_file_not_found(self): """test default file not found fallback""" with self.lyric_filename_test_setup() as ts: fp = os.path.join(ts.root, ts["artist"] + ".-." + ts["title"]) search = unquote(ts.lyric_filename) self.assertEqual(search, fp)