curds: Remove old playlist node less-than operator
We're comparing sort keys directly now, and not nodes Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
ea64bad17d
commit
7991ec44b2
|
@ -24,9 +24,6 @@ class PlaylistNode:
|
|||
if c != None:
|
||||
c.prev_child = b
|
||||
|
||||
def __lt__(self, rhs):
|
||||
return self.sort_key() < rhs.sort_key()
|
||||
|
||||
def __insert_node__(self, child, index):
|
||||
self.children.insert(index, child)
|
||||
self.__link_children__(self.nth_child(index - 1), child,
|
||||
|
|
|
@ -24,9 +24,6 @@ class Playlist(node.PlaylistNode):
|
|||
def __len__(self):
|
||||
return len(self.list)
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
|
||||
def __str__(self):
|
||||
l = len(self.list)
|
||||
return f"{self.name}\n{l} Track{'s' if l != 1 else ''}"
|
||||
|
|
|
@ -27,14 +27,6 @@ class TestPlaylistNode(unittest.TestCase):
|
|||
self.assertEqual(str(n), "<big>Test Node</big>")
|
||||
self.assertEqual(node.nodes.get(id(n)), n)
|
||||
|
||||
def test_node_less_than(self):
|
||||
a = node.PlaylistNode("a")
|
||||
b = node.PlaylistNode("b")
|
||||
|
||||
self.assertTrue( a < b)
|
||||
self.assertFalse(b < a)
|
||||
self.assertFalse(a < a)
|
||||
|
||||
def test_node_alloc(self):
|
||||
root = node.PlaylistNode()
|
||||
a = root.alloc_node("A")
|
||||
|
|
|
@ -65,13 +65,6 @@ class TestPlaylist(unittest.TestCase):
|
|||
self.add_tracks([1, 2])
|
||||
self.assertEqual(len(self.plist), 2)
|
||||
|
||||
def test_playlist__lt__(self):
|
||||
a = playlist.Playlist("A")
|
||||
b = playlist.Playlist("B")
|
||||
self.assertTrue( a < b)
|
||||
self.assertFalse(b < a)
|
||||
self.assertFalse(a < a)
|
||||
|
||||
def test_playlist__str__(self):
|
||||
self.assertEqual(str(self.plist), "Test Playlist\n0 Tracks")
|
||||
self.add_tracks([1])
|
||||
|
|
Loading…
Reference in New Issue
Block a user