lib: Give Tags support for the str() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
a6a35f37e7
commit
51fff44746
|
@ -26,6 +26,9 @@ class Tag:
|
|||
self.widgets = None
|
||||
self.lock = threading.Lock()
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def add_track(self, track):
|
||||
with self.lock:
|
||||
self.tracks.append(track)
|
||||
|
|
|
@ -11,6 +11,8 @@ class TestTag(unittest.TestCase):
|
|||
self.assertIsNone(t.widgets)
|
||||
self.assertIsInstance(t.lock, type(threading.Lock()))
|
||||
|
||||
self.assertEqual(str(t), "test")
|
||||
|
||||
def test_tag_len(self):
|
||||
t = tag.Tag("Test")
|
||||
self.assertEqual(len(t), 0)
|
||||
|
|
Loading…
Reference in New Issue