emmental/trackdb/test_tags.py

25 lines
909 B
Python
Raw Normal View History

# Copyright 2021 (c) Anna Schumaker.
from lib import tagstore
from . import tags
import unittest
class TestTags(unittest.TestCase):
def test_tags_init(self):
self.assertIsInstance(tags.Artist, tagstore.TagStore)
self.assertIsInstance(tags.Album, tagstore.TagSuperStore)
self.assertIsInstance(tags.Genre, tagstore.TagStore)
self.assertIsInstance(tags.Decade, tagstore.TagStore)
self.assertIsInstance(tags.Year, tagstore.TagSuperStore)
def test_tags_reset(self):
tags.Artist.store = {"a" : 1 }
tags.Album.store = {("a", "b") : 2 }
tags.Genre.store = {"c" : 3 }
tags.Decade.store = {"d" : 4 }
tags.reset()
self.assertEqual(tags.Artist.store, { })
self.assertEqual(tags.Album.store, { })
self.assertEqual(tags.Genre.store, { })
self.assertEqual(tags.Decade.store, { })