curds: Make sure we're properly setting prev / next pointers
I noticed that the toplevel playlist siblings were always set to None, so make sure we're properly setting these so they can be used. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
de9c7b0745
commit
33e2af2c2d
|
@ -11,12 +11,12 @@ class PlaylistNode:
|
|||
self.prev_child = None
|
||||
|
||||
def __link_children__(self, a, b, c):
|
||||
if a:
|
||||
if a != None:
|
||||
a.next_child = b
|
||||
b.parent = self
|
||||
b.prev_child = a
|
||||
b.next_child = c
|
||||
if c:
|
||||
if c != None:
|
||||
c.prev_child = b
|
||||
|
||||
def __lt__(self, rhs):
|
||||
|
|
|
@ -67,6 +67,9 @@ class TestPlaylistManager(unittest.TestCase):
|
|||
self.assertEqual(self.playman.nth_child(4), self.playman.lookup("Decades"))
|
||||
self.assertEqual(self.playman.nth_child(5), self.playman.lookup("Libraries"))
|
||||
|
||||
for i, plist in enumerate(self.playman.children):
|
||||
self.assertEqual(plist.next_child, self.playman.nth_child(i + 1))
|
||||
|
||||
self.assertEqual(self.playman.name, "Root")
|
||||
self.assertEqual(self.playman.current, [ self.playman.lookup("Collection") ])
|
||||
self.assertEqual(self.playman.track, None)
|
||||
|
|
Loading…
Reference in New Issue